local c=TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)script.Parent.Touched:connect(function(u)local p=(game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")):Create(u,c,{CFrame=spawn.CFrame})if u and(u.Parent and u.Parent:FindFirstChild("\072\117\109\097\110\111\105\100"))then local c=game.Players:GetPlayerFromCharacter(u.Parent)local K=game.ServerStorage:FindFirstChild("\067\104\101\099\107\112\111\105\110\116\068\097\116\097")if not K then K=Instance.new("\077\111\100\101\108",game.ServerStorage)K.Name="\067\104\101\099\107\112\111\105\110\116\068\097\116\097"end local C=K:FindFirstChild(tostring(c.userId))if not C then C=Instance.new("\079\098\106\101\099\116\086\097\108\117\101",K)C.Name=tostring(c.userId)c.CharacterAdded:connect(function(u)wait();(u:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")).CFrame=game.ServerStorage.CheckpointData[tostring(c.userId)].Value.CFrame+Vector3.new(0,4,0)end)end C.Value=spawn u.Anchored=true;(u.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")).PlatformStand=true p:Play()wait(1.8)p:Pause();(u.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")).PlatformStand=false u.Anchored=false end end)

local tweenInfo = TweenInfo.new(
	2, -- Time
	Enum.EasingStyle.Linear, -- EasingStyle
	Enum.EasingDirection.Out, -- EasingDirection
	0, -- RepeatCount (when less than zero the tween will loop indefinitely)
	false, -- Reverses (tween will reverse once reaching it's goal)
	0 -- DelayTime
)
script.Parent.Touched:connect(function(hit)
	
	local tweenToB = game:GetService("TweenService"):Create(hit, tweenInfo, {CFrame = spawn.CFrame})
	
	if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		local checkpointData = game.ServerStorage:FindFirstChild("CheckpointData")
		if not checkpointData then
			checkpointData = Instance.new("Model", game.ServerStorage)
			checkpointData.Name = "CheckpointData"
		end

		local checkpoint = checkpointData:FindFirstChild(tostring(player.userId))
		if not checkpoint then
			checkpoint = Instance.new("ObjectValue", checkpointData)
			checkpoint.Name = tostring(player.userId)

			player.CharacterAdded:connect(function(character)
				wait()
				character:WaitForChild("HumanoidRootPart").CFrame = game.ServerStorage.CheckpointData[tostring(player.userId)].Value.CFrame + Vector3.new(0, 4, 0)
			end)
		end

		checkpoint.Value = spawn
		hit.Anchored = true
		hit.Parent:FindFirstChild('Humanoid').PlatformStand = true
		tweenToB:Play()
		wait(1.8)
		tweenToB:Pause()
		hit.Parent:FindFirstChild('Humanoid').PlatformStand = false
		-- game.Players:GetPlayerFromCharacter(hit.Parent):FindFirstChild('Humanoid').PlatformStand = false
		hit.Anchored = false
	end
end)
