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

leaderstats folder not being added to player on join?

Asked by 3 years ago

So I am not getting any errors but the leaderboard is not being shown and the leaderstats folder is not added to the player when they join. Why?

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

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

Any help would be greatly appreciated

1 answer

Log in to vote
3
Answered by
appxritixn 2235 Moderation Voter Community Moderator
3 years ago

You made a spelling mistake:

game.Players.PlayerAdded:Connect(function(player) -- was "plyaer"
    local leaderstats = Instance.new("Folder")
    leaderstats.Parent = player
    leaderstats.Name = "leaderstats"

    local stars = Instance.new("IntValue")
    stars.Parent = leaderstats
    stars.Name = "Stars"
    stars.Value = 0
end)
0
omg I can't believe that is all it was. Thank you!! archmageofmle 49 — 3y
0
bro did you just speedrun obtain accepted answer on a dead site? grats man User#30567 0 — 3y
0
lmao smash2002 40 — 3y
Ad

Answer this question