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

leaderstats folder not being added to player on join?

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

✓ Accepted answer

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)

3 comments

0

omg I can't believe that is all it was. Thank you!!

0

bro did you just speedrun obtain accepted answer on a dead site? grats man

0

lmao

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