ThePCGuy Posted July 5, 2013 Share 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. Link to comment
Castillo Posted July 5, 2013 Share Posted July 5, 2013 http://lua-users.org/wiki/ForTutorial Link to comment
ThePCGuy Posted July 5, 2013 Author Share 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. Link to comment
Castillo Posted July 5, 2013 Share Posted July 5, 2013 for index, player in ipairs ( getElementsByType ( "player" ) ) do -- Do something end That's what you meant? Link to comment
ThePCGuy Posted July 5, 2013 Author Share 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. Link to comment
Castillo Posted July 5, 2013 Share Posted July 5, 2013 I don't understand your question. Link to comment
ThePCGuy Posted July 5, 2013 Author Share Posted July 5, 2013 for index, player <--- is this a element ? Link to comment
Castillo Posted July 5, 2013 Share Posted July 5, 2013 Depends on the table, 'for' is used for loops in general, not just for tables with player elements. Link to comment
PaiN^ Posted July 5, 2013 Share 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 ... Link to comment
Stylez Posted July 6, 2013 Share Posted July 6, 2013 thanks, that helped me alot too LoL, Loops and tables are probably hardest things in Lua Link to comment
iPrestege Posted July 6, 2013 Share 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! Link to comment
Stylez Posted July 6, 2013 Share 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! Link to comment
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