I need to do a leader table. This means something like:
Richest: $99999
Middle: $500
Poor: $5
Nick: his money
and I want to sort it who is the richest to who has the least cash. I currently have:
Cash leaderstat, a GUI:
GUI (it's a surface gui)
and a refresh statement: while wait(5) do [for updating every 5 sec)
I need a loop to get the richest. I know how to do a loop for getting players and the index number, but I need to check who's the richest. It would be nice if it already came with DataStores too, but no pressure.
I know it's a kinda hard question, thanks for trying to answer.
Edit: the only thing I have its this gui and this:
1 | while wait( 5 ) do |
2 | for i, v in pairs (game.Players:GetPlayers()) do |
3 | print (i.. ": " ..v) |
4 | end |
5 | end |