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

How would I create a gui that lists the top people in server from richest to poorest?

Asked by 8 years ago
Edited 8 years ago

I got 4 text labels.
I've tried this already:

01Monies = {}
02 
03for _,player in pairs(game.Players:GetPlayers()) do
04local money = player.leaderstats:FindFirstChild("Money")
05table.insert(Monies,{player.Name,money.Val})
06end
07 
08table.sort(Monies)
09 
10for _,v in pairs(Monies) do
11script.Parent.F.Text = v[1] --Text label 1
12script.Parent.S.Text = v[2] --Text label 2
13script.Parent.T.Text = v[3] --Text label 3
14script.Parent.Fo.Text = v[4] --Text label 4
15end
0
Please explain what is going wrong, is it in the wrong order? because table.sort sorts them from least to greatest, not greatest to least. connor12260311 383 — 8y
0
That script was wrong in all ways.. it was sorting a table in a table. I want it to sort a table and shown on Gui SmxkePurpp 50 — 8y

Answer this question