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

Why is my leaderboard script not making a leaderboard when I test it in a local server?

I'm currently learning scripting from Peasfactory's youtube channel. I'm currently working on making my first leaderboard and using the script I made below.

game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("IntValue", player) stats.Name = "Leaderstats"

local points = Instance.new("IntValue", leaderstats)
points.Name = "Points"
points.Value = 0

end)

For some reason everytime I tried testing it the leaderboard does not show up. I am testing this in a local 1 player server and not in a solo server. I have also tried it with multiple players and the leaderboard still does not show up. I have even gone to other youtube channels who suggested I change the "local leaderstats" from an "intvalue" to "folders", "models", etc. Those did not work either. I am suspecting that "Filtering Enabled is the main culprit here but I am very unsure of this as I am still just a beginner. Any feedback and help would be greatly appreciated. Thank you for taking the time to help address my issue.

3 comments

0

The l in Leaderstats needs to be lowercase. Just change it to "leaderstats"

0

Also the points parent needs to be stats.

0

not leaderstats leaderstats may be the name but the variable that we are working with is stats. So use points.Parent = stats

1 answer

You have some errors in your code. First of all, you tried to name "stats", which doesn't exist. Also, leaderstats should be a lowercase l not uppercase.

Here's the script that worked for me.

game.Players.PlayerAdded:Connect(function(player)
	local leaderstats = Instance.new("IntValue", player) 
	local points = Instance.new("IntValue", leaderstats)	
	leaderstats.Name = "leaderstats"
	points.Name = "Points"	
	points.Value = 0
end)

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