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

Why aren't two leaderboards displaying?

Asked by 7 years ago

In my game that i'm currently working on, I wanted there to be a coin leader board and a level leader board. I got the coin to work with this script: game.Players.PlayerAdded:connect(function(player) stat = Instance.new("IntValue") stat.Name = "leaderstats" stat.Parent = player cash = Instance.new("IntValue") cash.Name = "Cash" cash.Parent = stat end) So I just used that again, but then it only displayed either the coin leader board with 0 and the skill leader board with a - in place of the 0, or the other way around. Anyone know how to get these to both show up?

0
Can you pls put your code in a code block it helps ppl read it. User#5423 17 — 7y
0
Yeah sorry, I didn't know how to do that at the time. Eyeball53 2 — 7y

1 answer

Log in to vote
0
Answered by
Etheroit 178
7 years ago

Leaderboard gets only one holder so You cant put two holders. If You want to display more than one stat then just add more IntValues in this holders.

game.Players.PlayerAdded:connect(function(plr)
 local leaderboardholder = Instance.new("Folder", plr) -- HOLDER
 leaderboardholder.Name = "leaderstats"
local cash = Instance.new("IntValue", leaderboardholder) -- Stat No 1
cash.Name = "Cash"
local kos = Instance.new("IntValue", leaderboardholder) -- Stat No 2
kos.Name = "Kos"
end)

And You can copy these two lines, give stats names and they will be displayed on leaderboard

Ad

Answer this question