local function k(k)local f=k.Character or k.CharacterAdded:wait()local v=f:WaitForChild("\072\117\109\097\110\111\105\100")local w=Instance.new("\070\111\108\100\101\114")w.Name="\115\116\097\116\115"w.Parent=k local b=Instance.new("\078\117\109\098\101\114\086\097\108\117\101")b.Name=GameSettings.pointsName b.Value=DataStore:GetCurrentPoints(k)b.Parent=w local N=Instance.new("\073\110\116\086\097\108\117\101")N.Name="\084\111\116\097\108"..GameSettings.pointsName N.Value=DataStore:GetTotalPoints(k)N.Parent=w local c=Instance.new("\073\110\116\086\097\108\117\101")c.Name=GameSettings.upgradeName c.Value=DataStore:GetUpgrades(k)c.Parent=w end

local function setupPlayerStats(player)
	local character = player.Character or player.CharacterAdded:wait()
	local humanoid = character:WaitForChild("Humanoid")	
	
	local stats = Instance.new("Folder")
	stats.Name = "stats"
	stats.Parent = player
 
	local points = Instance.new("NumberValue")
	points.Name = GameSettings.pointsName
	points.Value = DataStore:GetCurrentPoints(player)
	points.Parent = stats

	local totalpoints = Instance.new("IntValue")
	totalpoints.Name = "Total" .. GameSettings.pointsName
	totalpoints.Value = DataStore:GetTotalPoints(player)
	totalpoints.Parent = stats
	
	local upgrade = Instance.new("IntValue")
	upgrade.Name = GameSettings.upgradeName
	upgrade.Value = DataStore:GetUpgrades(player)
	upgrade.Parent = stats
end
