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

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

Asked by 10 years ago

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

Log in to vote
1
Answered by
Ekkoh 635 Moderation Voter
10 years ago

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)
0
Thanks! FamousDoge 0 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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)

Answer this question