DakiLLa Posted March 13, 2009 Share Posted March 13, 2009 hi. i have one problem here.. i want to get a player with max value of points and print his name. Lets suppose that we have 3 players with their points: First - 500 points Second - 1000 points Fird - 2000 points how to check which player has more points than all others players? May be create a table with players? if it's, how to make this points-check? Thx for replies Link to comment
Ace_Gambit Posted March 13, 2009 Share Posted March 13, 2009 bla = {} bla[500] = "player1" bla[1000] = "player2" bla[2000] = "player3" print(bla[table.maxn(bla)].." has the highest score.") Link to comment
Lordy Posted March 15, 2009 Share Posted March 15, 2009 Wouldn't work if two people would have 2000 points at the same time.. Link to comment
DakiLLa Posted March 15, 2009 Author Share Posted March 15, 2009 hmm..forgot about this.. so? Ace, can you fix this? 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