local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local LocalPlayer = Players.LocalPlayer local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart") local checkpointsFolder = Workspace:WaitForChild("Checkpoints") local leaderstats = LocalPlayer:WaitForChild("leaderstats") local stageStat = leaderstats:WaitForChild("Stage") print("script started") while true do local currentStage = stageStat.Value local nextStage = currentStage + 1 local cp = checkpointsFolder:FindFirstChild(tostring(nextStage)) if not cp then local highestNum = 0 local highestPart = nil for _, v in ipairs(checkpointsFolder:GetChildren()) do local num = tonumber(v.Name) if num and num > highestNum then highestNum = num highestPart = v end end if highestPart then local p = highestPart:IsA("BasePart") and highestPart or highestPart:FindFirstChildWhichIsA("BasePart") if p then HumanoidRootPart.CFrame = p.CFrame + Vector3.new(0, 3, 0) end end task.wait(0.01) cp = checkpointsFolder:FindFirstChild(tostring(nextStage)) end if not cp then print(string.format("reached maximum stage: %d", stageStat.Value)) break end local targetPart = cp:IsA("BasePart") and cp or cp:FindFirstChildWhichIsA("BasePart") if targetPart then HumanoidRootPart.CFrame = targetPart.CFrame + Vector3.new(0, 3, 0) task.wait(0.01) firetouchinterest(targetPart, HumanoidRootPart, 0) firetouchinterest(targetPart, HumanoidRootPart, 1) local t0 = tick() while stageStat.Value < nextStage and (tick() - t0) < 0.25 do task.wait(0.01) end end if stageStat.Value == currentStage then task.wait(0.1) if stageStat.Value == currentStage then warn(string.format("stopped at stage %d", currentStage)) break end end end