Forja

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

  1. 1Add a Folder to Workspace and name it Checkpoints.
  2. 2Put your checkpoint Parts in it, Anchored, named 1, 2, 3 and so on, in the order players reach them.
  3. 3In the Explorer, hover over ServerScriptService, press +, choose Script and paste this in.
Checkpoints · a Script in ServerScriptService
-- 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.
  • CharacterAdded runs 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 Stage the way the saving script saves coins.
No skipping
Change number > stage.Value to number == stage.Value + 1.
Want something more? The script generator can write it: “An obby checkpoint system that saves the player's stage between visits and has a button to go back a stage”

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