Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

How to loop through players, and get who is the richest?

Asked by
NorteX_tv 101
5 years ago
Edited 5 years ago

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:

while wait(5) do
    for i, v in pairs(game.Players:GetPlayers()) do
        print(i..": "..v)
    end
end
0
find which IntValue is the largest (all numbers you are mentioned have to be IntValues) DeceptiveCaster 3761 — 5y
0
You have to do more of an attempt than just 5 lines Shawnyg 4330 — 5y
0
but how NorteX_tv 101 — 5y
0
use OrderedDataStore HaveASip 494 — 5y
0
thanks, but HOW? NorteX_tv 101 — 5y

Answer this question