ThePCGuy Posted July 5, 2013 Posted July 5, 2013 Hi, Is there a tutorial for: example: for index, players in ipairs( something ) do I dont know how to use it and what to fill in.
ThePCGuy Posted July 5, 2013 Author Posted July 5, 2013 Ok. But, for index, players <---- (is there a list of what i can fill in here?) in ipairs( something ) do Thanks.
Castillo Posted July 5, 2013 Posted July 5, 2013 for index, player in ipairs ( getElementsByType ( "player" ) ) do -- Do something end That's what you meant?
ThePCGuy Posted July 5, 2013 Author Posted July 5, 2013 I meant, is there a list of where can i get the index of, now you will get all the players.
Castillo Posted July 5, 2013 Posted July 5, 2013 Depends on the table, 'for' is used for loops in general, not just for tables with player elements.
PaiN^ Posted July 5, 2013 Posted July 5, 2013 If you mean that is it necessary to be "index, player" then No, You can but whatever you want . for k,v ... for index,player ... for i, anything ...
Stylez Posted July 6, 2013 Posted July 6, 2013 thanks, that helped me alot too LoL, Loops and tables are probably hardest things in Lua
iPrestege Posted July 6, 2013 Posted July 6, 2013 thanks, that helped me alot too LoL, Loops and tables are probably hardest things in Lua No it's the easier thing!
Stylez Posted July 6, 2013 Posted July 6, 2013 thanks, that helped me alot too LoL, Loops and tables are probably hardest things in Lua No it's the easier thing! If its easy for you, could you make a tutorial where you create any kind of system with tables and loops and lots of detailed explanations, that would be great!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now