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

why is it not showing up in the leader board?

local players = game:GetService("Players")

players.PlayerAdded:connect(function(players)
	if players then 
		local folder = Instance.new("Folder")
		folder.Name = "leaderstats" 
		folder.Parent = players
		local Coins = Instance.new("IntValue")
		Coins.name = "Coins"
		Coins.Parent = folder
		Coins.value = 125
	end
end)

2 comments

0

change the argument in the function to just "player", and change the parent of the folder to "player"

0

You shouldn't have 2 same variables/parameters. You set players value to both the player (parameter) that joined and the service

1 answer

You have some spelling mistakes thats why it doesnt work, this should work!

local players = game:GetService("Players")

players.PlayerAdded:Connect(function(player)
	
	local folder = Instance.new("Folder")
	folder.Parent = player
	folder.Name = "leaderstats"
	
	local Coins = Instance.new("IntValue")
	Coins.Parent = folder
	Coins.Name = "Coins"
	Coins.Value = 125
	
end)

Read more here: https://developer.roblox.com/en-us/articles/Leaderboards

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