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.
Castillo Posted July 5, 2013 Posted July 5, 2013 http://lua-users.org/wiki/ForTutorial San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 I don't understand your question. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 ... " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Castillo Posted July 5, 2013 Posted July 5, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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