game.Players.PlayerAdded:Connect(function(v)DataManger.AddPlayerData(v)v.CharacterAdded:Connect(function(R)local E=R:WaitForChild("\072\117\109\097\110\111\105\100")E.JumpPower=0 E.JumpHeight=0 if v.Data.spawnpoint.Value~=""then local E=R:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local e=workspace.Interactions.Checkpoints:FindFirstChild(v.Data.spawnpoint.Value)if e then task.wait(.5)E.CFrame=e.Root.CFrame*CFrame.new(0,3,0)else warn("\078\079 \067\072\069\067\075\080\079\073\078\084 \070\079\085\078\068 \087\073\084\072 \084\072\069 \078\065\077\069\058 "..(v.Data.spawnpoint.Value.." \068\073\068 \089\079\085 \083\069\084 \085\080 \065 \067\072\069\067\075\080\079\073\078\084 \087\073\084\072 \084\072\065\084 \078\065\077\069\063"))end end end)end)game.Players.PlayerRemoving:Connect(DataManger.RemovePlayerData)
--this function runs when players join your game
game.Players.PlayerAdded:Connect(function(player)
	DataManger.AddPlayerData(player)
	--this function runs when your player is added to the world, it also runs again when you reset
	player.CharacterAdded:Connect(function(char)
		--this is called the player humanoid, it handles a lot of things like animations, jumping, walkspeed
		local humanoid = char:WaitForChild("Humanoid")

		--this is setting your jump power to 0, too disable player jumping!
		humanoid.JumpPower = 0
		humanoid.JumpHeight = 0

		--this is handling for teleporting players to the checkPoints :)
		if player.Data.spawnpoint.Value ~= "" then
			local rootPart = char:WaitForChild("HumanoidRootPart")

			local foundCheckpoint = workspace.Interactions.Checkpoints:FindFirstChild(player.Data.spawnpoint.Value)

			if foundCheckpoint then
				task.wait(0.5)

				rootPart.CFrame = (foundCheckpoint.Root.CFrame * CFrame.new(0, 3, 0))
			else
				warn(
					"NO CHECKPOINT FOUND WITH THE NAME: "
						.. player.Data.spawnpoint.Value
						.. " DID YOU SET UP A CHECKPOINT WITH THAT NAME?"
				)
			end
		end
	end)
end)

game.Players.PlayerRemoving:Connect(DataManger.RemovePlayerData)
