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

My leaderstats script will not produce leaderstats. Help?

My leaderstats script:

game.Players.PlayerAdded:Connect(function(plr)
	local stats = Instance.new("Folder")
	stats.Name = "Stats"
	stats.Parent = plr
	
	local DR = Instance.new("IntValue")
	DR.Name = "Dice Rolls"
	DR.Parent = stats
end)

2 answers

✓ Accepted answer

In order for the stats to show up on the leaderboard, the stats folder needs to actually be named "leaderstats" (must be all lowercase). Here's the corrected code:

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

    local DR = Instance.new("IntValue")
    DR.Name = "Dice Rolls"
    DR.Parent = stats
end)

Hope this helps.

1 comment

0

Thank you!

The name of the stats must be "leaderstats":


game.Players.PlayerAdded:Connect(function(plr)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = plr
	 
local DR = Instance.new("IntValue")
DR.Name = "Dice Rolls"
DR.Parent = stats
end)

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