Leaderboard

From Legacy Roblox Wiki
Revision as of 01:53, 7 January 2009 by >DarkWolfXV (New page: <pre> function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local c = Instance.new("IntValue") c.Name = "Money" c.Value = 0 c.Parent...)
Jump to navigationJump to search
function onPlayerEntered(newPlayer)
	local stats = Instance.new("IntValue")
	stats.Name = "leaderstats"

	local c = Instance.new("IntValue")
	c.Name = "Money"
	c.Value = 0

	c.Parent = stats

	stats.Parent = newPlayer 

	newPlayer.Changed:connect(function (property)
		if (property == "Character") then
			onPlayerRespawned(newPlayer)
		end
	end)
end

game.Players.ChildAdded:connect(onPlayerEntered)