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

Issue with leaderstats?

game.Players.PlayerAdded:connect(function(player)
	
	stats = Instance.new("IntValue", player)
	stats.Name = "leaderstats"
	
	money = Instance.new("IntValue", stats)
	money.Name = "Money"
	
	kills = Instance.new("IntValue",stats)
	kills.Name = "Kills"
	
	died = Instance.new("IntValue", stats)
	died.Name = "Deaths"
	
end)

I'm trying to create a leaderboard with money, kills, and deaths. Bizarrely it only loads Money. Any ideas?

1 comment

0

Script works fine. Might I suggest making the variables local though?

1 answer

When I tried this script, it worked fine. I don't see anything wrong with it. I'd suggest when you do variables, do local variables. Example:

local money = game.Workspace.Money

The method you are using sometimes confuses your self or others. I suggest using the local.

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