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

Why does my leaderboard script show only one of the 4 values in game?

Asked by 8 years ago
function PlayerEntered(newPlayer)
local stats = Instance.new("IntValue")
stats.Parent = newPlayer
stats.Name = "leaderstats"

local coins = Instance.new("IntValue")
coins.Parent = stats
coins.Name = "Coins"
coins.Value = 0

local diamonds = Instance.new("IntValue")
diamonds.Parent = stats
diamonds.Name = "Diamonds"
diamonds.Value = 0

local level = Instance.new("IntValue")
level.Parent = stats
level.Name = "Level"
level.Value = 0

local exp = Instance.new("IntValue")
exp.Parent = stats
exp.Name = "Exp"
exp.Value = 0

end

game.Players.ChildAdded:connect(PlayerEntered)

Could someone help me? In the actual game server when i test the leaderboard only one of the values has 0, the rest have no value, just the name, help please?

1 answer

Log in to vote
0
Answered by 8 years ago

I just tested it and it works in both studio and server. What exactly is the problem? It does show the value for me

Ad

Answer this question