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

Leaderboard fail, need help?

I am making a tycoon with a leaderboard for cash.

-- leaderboard made by roboy5857

function onPlayerEntered(newPlayer)
	local stats = Instance.new("IntValue")
	stats.Name = "leaderstats"

	local Moneyz = Instance.new("IntValue")
	Moneyz.Name = "Moneyzz"
	Moneyz.Value = 5
	
	Moneyz.Parent = stats
end

It won't work, why?

1 answer

✓ Accepted answer

Try this instead.

function onPlayerEntered(newPlayer)

	local stats = Instance.new("IntValue")
	stats.Name = "leaderstats"

	local cash = Instance.new("IntValue")
	cash.Name = "Moneyzz"
	cash.Value = 5

	cash.Parent = stats
	stats.Parent = newPlayer
end



game.Players.ChildAdded:connect(onPlayerEntered)
--You forgot to connect the function like this above

Please note: That if you don't connect a function it's pretty much useless and it wouldn't work.

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