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?

01game.Players.PlayerAdded:Connect(function(plyaer)
02    local leaderstats = Instance.new("Folder")
03    leaderstats.Parent = player
04    leaderstats.Name = "leaderstats"
05 
06    local stars = Instance.new("IntValue")
07    stars.Parent = leaderstats
08    stars.Name = "Stars"
09    stars.Value = 0
10end)

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:

01game.Players.PlayerAdded:Connect(function(player) -- was "plyaer"
02    local leaderstats = Instance.new("Folder")
03    leaderstats.Parent = player
04    leaderstats.Name = "leaderstats"
05 
06    local stars = Instance.new("IntValue")
07    stars.Parent = leaderstats
08    stars.Name = "Stars"
09    stars.Value = 0
10end)
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