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

My leaderboard doesn't show? What's the problem?

I used this for my leadboard script

function playerAdded()
	local Id =  Instance.new("IntValue")
	Id.Name = "leaderstats"
	local points =  Instance.new("IntValue",Id)
	points.Name = "Money"
	Id.Parent = player
end

When I go into a game, it doesn't show? Can I get help?

2 answers

✓ Accepted answer

First of all, make sure you include your parameter, player, in the parentheses. Your function declaration should look like this.

function playerAdded(player)

Secondly, you didn't connect your function to the PlayerAdded event. Add this line to the bottom of your script.

Game:GetService("Players").PlayerAdded:connect(playerAdded)

1 comment

0

Thanks!

I haven't tested it but I've done it a million times so it SHOULD work.

game.Players.PlayerAdded:connect(function(plr)
    local Id =  Instance.new("IntValue",plr)
    Id.Name = "leaderstats"
    local points =  Instance.new("NumberValue",Id)
    points.Name = "Money"
    points.Value = 0
end)

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