Jump to content

index


Recommended Posts

Posted
for index, player in ipairs ( getElementsByType ( "player" ) ) do 
    -- Do something 
end 

That's what you meant?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I don't understand your question.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 !

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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! :)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...