Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What are some troubleshooting tips/fixes for leaderboard not showing?

My leaderboard was working perfectly when I first added the script, but now the stats don't show up. I haven't changed the script one bit.

local function onPlayerJoin(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player
 
	local Coin = Instance.New("IntValue")
	Coin.Name = "Coins"
	Coin.Value = 0
	Coin.Parent = leaderstats
	
	local Die = Instance.new("IntValue")
	Die.Name = "Deaths"
	Die.Value = 0
	Die.Parent = leaderstats
	
	local Insta = Instance.new("IntValue")
	Kill.Name = "Kills"
	Kill.Value = 0
	Kill.Parent = leaderstats
	
	local Wins = Instance.new("IntValue")
	Wins.Name = "Wins"
	Wins.Value = 0
	Wins.Parent = leaderstats
	
end
 
game.Players.PlayerAdded:Connect(onPlayerJoin)

I don't even know where to start since I haven't changed the script.

1 answer

✓ Accepted answer
game.Players.PlayerAdded:Connect(function(player)
	local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    local Coin = Instance.new("IntValue")
    Coin.Name = "Coins"
    Coin.Value = 0
    Coin.Parent = leaderstats

    local Die = Instance.new("IntValue")
    Die.Name = "Deaths"
    Die.Value = 0
    Die.Parent = leaderstats

    local Insta = Instance.new("IntValue")
    Insta.Name = "Kills"
    Insta.Value = 0
    Insta.Parent = leaderstats

    local Wins = Instance.new("IntValue")
    Wins.Name = "Wins"
    Wins.Value = 0
    Wins.Parent = leaderstats
end)

That's the fixed code, there were 2 problems, The first is that at

local Coin = Instance.New("IntValue")

You put the "N" of ".new" as capital, which resulted in an error, the second is that you put "Kill" instead of Insta.

1 comment

0

THANK YOU. The Kill/Insta is supposed to be that. it's funny how the one letter where I held shift made the whole script fail since it was the first value.

This discussion is preserved as it was. New answers, comments, and votes are closed.