local function D(D,f)local s=D:WaitForChild("\115\116\097\116\115")local T=s:WaitForChild(GameSettings.pointsName)local l=s:WaitForChild("\084\111\116\097\108"..GameSettings.pointsName)T.Value=T.Value+f if f>0 then l.Value=l.Value+f end DataStore:IncrementPoints(D,f)end local function f(D)local f=D:WaitForChild("\115\116\097\116\115")local s=f:WaitForChild(GameSettings.pointsName)local T=f:WaitForChild(GameSettings.upgradeName)UpgradeManager:BuyUpgrade(D)end local function s(D)ParticleController.EmitCheckpointParticle(D)end local function T(D)UpgradeManager:AddUpgrade(D)end local function l(D,f)if f then D.DevComputerMovementMode=Enum.DevComputerMovementMode.UserChoice D.DevTouchMovementMode=Enum.DevTouchMovementMode.UserChoice else D.DevComputerMovementMode=Enum.DevComputerMovementMode.Scriptable D.DevTouchMovementMode=Enum.DevTouchMovementMode.Scriptable end end local function B(D)UpgradeManager:SetWalkspeedToCurrentUpgrade(D)end

local function updatePlayerPoints(player, valueToAdd)
	local stats = player:WaitForChild("stats")
	local points = stats:WaitForChild(GameSettings.pointsName)
	local totalPoints = stats:WaitForChild("Total"..GameSettings.pointsName)
	
	points.Value = points.Value + valueToAdd
	if valueToAdd > 0 then
		totalPoints.Value = totalPoints.Value + valueToAdd
	end
	DataStore:IncrementPoints(player, valueToAdd)
end

local function makeUpgradePurchase(player)
	local stats = player:WaitForChild("stats")
	local points = stats:WaitForChild(GameSettings.pointsName)
	local upgrades = stats:WaitForChild(GameSettings.upgradeName)
	
	UpgradeManager:BuyUpgrade(player)
end

local function touchCheckpoint(player)
	ParticleController.EmitCheckpointParticle(player)
end

local function addPlayerUpgrade(player)
	UpgradeManager:AddUpgrade(player)
end

local function changeController(player, defaultController)
	if defaultController then
		player.DevComputerMovementMode = Enum.DevComputerMovementMode.UserChoice
		player.DevTouchMovementMode = Enum.DevTouchMovementMode.UserChoice
	else
		player.DevComputerMovementMode = Enum.DevComputerMovementMode.Scriptable
		player.DevTouchMovementMode = Enum.DevTouchMovementMode.Scriptable
	end
end

local function onPlayerEnteredGame(player)
	UpgradeManager:SetWalkspeedToCurrentUpgrade(player)
end

