DarkLight Posted March 28, 2008 Share Posted March 28, 2008 Is their a for command? Example for(i=0 i > getPlayerCount() i++) Link to comment
Ace_Gambit Posted March 28, 2008 Share Posted March 28, 2008 Yes there is. Although with a slightly different syntax: http://lua-users.org/wiki/ForTutorial Link to comment
tma Posted March 28, 2008 Share Posted March 28, 2008 To loop through all players ? Something like: for _,player in pairs(getElementsByType("player")) do -- stuff end Link to comment
lil Toady Posted March 31, 2008 Share Posted March 31, 2008 for(i=0 i > getPlayerCount() i++) That'll look like for i = 0, getPlayerCount() do --your code end There are better ways to loop through players though, like for id, player in ipairs ( getElementsByType ( "player" ) ) do something() end 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