Roblox obby checkpoint script
The script every obby needs: players respawn on the last checkpoint they reached, and their stage shows beside their name.
Where it goes
- 1Add a Folder to Workspace and name it Checkpoints.
- 2Put your checkpoint Parts in it, Anchored, named 1, 2, 3 and so on, in the order players reach them.
- 3In the Explorer, hover over ServerScriptService, press +, choose Script and paste this in.
-- From forja.us/tools/roblox-scripts/checkpoints-- Players respawn on the last checkpoint they touched.local Players = game:GetService("Players")local checkpoints = workspace:WaitForChild("Checkpoints")local function setUpCheckpoint(part) local number = tonumber(part.Name) if not number or not part:IsA("BasePart") then return end part.Touched:Connect(function(hit) local character = hit:FindFirstAncestorOfClass("Model") local player = character and Players:GetPlayerFromCharacter(character) local leaderstats = player and player:FindFirstChild("leaderstats") local stage = leaderstats and leaderstats:FindFirstChild("Stage") if stage and number > stage.Value then stage.Value = number end end)endfor _, part in checkpoints:GetChildren() do setUpCheckpoint(part)endlocal function onPlayerAdded(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local stage = Instance.new("IntValue") stage.Name = "Stage" stage.Parent = leaderstats player.CharacterAdded:Connect(function(character) local checkpoint = checkpoints:FindFirstChild(tostring(stage.Value)) if checkpoint then character:WaitForChild("HumanoidRootPart") task.wait() character:PivotTo(checkpoint.CFrame + Vector3.new(0, 4, 0)) end end)endPlayers.PlayerAdded:Connect(onPlayerAdded)How it works
- Each part's name is its number: touching a higher one than the player's stage raises it.
CharacterAddedruns at each respawn, and moves them to the checkpoint for their stage.- At stage 0 they start at your normal spawn, so nothing else needs changing.
Make it yours
- Keep their stage next visit
- Save
Stagethe way the saving script saves coins. - No skipping
- Change
number > stage.Valuetonumber == stage.Value + 1.
Maps to try it on: low poly maps
Start from a finished map, and your scripts have a game to run in.
More free Roblox scripts
Roblox kill brick scriptRoblox leaderboard scriptRoblox save data scriptRoblox sprint scriptRoblox double jump scriptRoblox teleport scriptRoblox coin pickup scriptRoblox day and night cycle scriptRoblox game pass scriptRoblox developer product scriptRoblox door scriptRoblox tool giver scriptRoblox round system scriptRoblox background music scriptRoblox speed pad scriptRoblox jump pad scriptRoblox VIP door scriptRoblox daily reward scriptRoblox NPC dialogue scriptRoblox pet follow scriptRoblox gun scriptRoblox admin commands scriptRoblox tycoon dropper scriptRoblox shop GUI script

