How do I order the leaderboard?

I have a game with a leaderboard that has multiple values. The player money, level, etc. It is ordered by the player names. How do I change it so it’s ordered by the levels?

What do you mean by that? Do you mean if you level up you get more money?

If you want it like that you do:


local leaderstats =“Folder”)
leaderstats.Name = leaderstats
leaderstats.Parent = player

local coins =“IntValue”)
coins.Name = “Coins”
coins.Parent = leaderstats

local level =“IntValue”)
level.Name = “Level”
level.Parent = player

if Level.Value == 1 then
Coins.Value = Coins.Value + --However much you want the player to get

No, I mean. The leaderboard rn looks something like this:

Name		Level		Coins
deiviircs		2			37
Mestik78		5			20
Sentrox17		3			15

and I want it to be shorted by the level, something like this:

Name		Level		Coins
Mestik78		5			20
Sentrox17		3			15
deiviircs		2			37

So you want the person with the highest level at the top?

yes, that’s what I want to do…

i an pretty sure roblox already does this to the first value that is added to the leaderstats folder.


Ye thats the new thing, maybe this is offtopic?

Ok can I see the script so I can work it out

Ok I think I got the script. Here it is:


local leaderstats ="Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

local Level ="IntValue")
Level.Name = "Level"
Level.Parent = leaderstats
Level.Value = 100

local Coins ="IntValue")
Coins.Name = "Coins"
Coins.Parent = leaderstats
Coins.Value = 50


You could also use team test and on the bottom of your screen you see a command bar. In the command bar say:

game.Workspace.Players.Player1.leaderstats.Level.Value = 1000

then you do:

game.Workspace.Players.Player2.leaderstats.Coins.Value = 1000000000000000000000000000

This will still make Player1 the highest.