Start building

How to make an obby in Roblox Studio (checkpoints, kill bricks and a timer)

Go from an empty baseplate to a finished obby: stages that ramp up, one script for every kill brick, checkpoints that save and a timer at the finish.

An obby playtest in Roblox Studio: coin and stage counters, a run timer, a quest card and coloured platforms leading up to a trophy, with the StageTimer script Revix wrote.
On this page
  1. Plan your stages and difficulty curve
  2. Build the platforms
  3. Kill bricks: one script for every part
  4. Checkpoints and a Stage leaderstat
  5. Save each player's stage
  6. Moving and disappearing platforms
  7. A finish line with a run timer
  8. Playtest like a new player
  9. Questions

To make an obby in Roblox Studio, build a path of anchored platforms, add kill bricks that reset players, and place numbered checkpoints that remember how far each player got. Two short server scripts do most of the work: one runs every kill brick through a CollectionService tag, and one tracks a Stage value and respawns players at their checkpoint. After that you save the stage, add moving platforms and put a timer on the finish line.

New to Studio? Read how to make a Roblox game first for the basics of parts, scripts and publishing.

Plan your stages and difficulty curve

A stage is one short challenge that ends on a checkpoint. Players decide fast whether they like an obby, so the first stages should be easy wins and the hard ones should come once they are hooked.

Write the stage list before you build. A curve like this works for a 25 stage obby:

StagesWhat they doExamples
1 to 5Teach the controlsWide platforms, short gaps, no danger
6 to 15Add one new danger at a timeKill brick floors, thin beams, a first moving platform
16 to 25Combine what players learnedMoving and fading platforms together, longer jumps
Every 5thLet players breatheA big safe platform with nothing to dodge

Show each new obstacle once in a safe version before you mix it with others. Players forgive hard stages. They quit on unfair ones.

Build the platforms

Start from the Baseplate template. Insert a part with Home > Part, size it with the Scale tool and place it with Move. Then tick Anchored in Properties, or the part falls when the game starts.

  1. Keep each stage in a Folder (Stage1, Stage2 and so on) inside a Stages folder in Workspace.
  2. Turn on move snapping in the Model tab so your gaps are exact.
  3. Keep early gaps short, around 4 to 6 studs, and test the widest jumps yourself, since jump distance depends on the character's speed and jump settings.
  4. Use color as a rule: red always kills, green is always a checkpoint.

Swap the baseplate for a big kill floor a little below your stages. A fall then resets the player at once instead of a long drop into the void.

Kill bricks: one script for every part

A script inside every kill brick works until you have 200 of them and need to change one line. Tag the parts instead and let one script handle them all. Select a kill brick, find Tags at the bottom of Properties and add the tag KillBrick. Copies keep the tag.

ScriptServerScriptService
-- Script in ServerScriptService: kills any character that touches a part tagged "KillBrick"
local CollectionService = game:GetService("CollectionService")

local function onTouched(hit)
	local humanoid = hit.Parent and hit.Parent:FindFirstChildOfClass("Humanoid")
	if humanoid and humanoid.Health > 0 then
		humanoid.Health = 0
	end
end

local function setup(part)
	if part:IsA("BasePart") then
		part.Touched:Connect(onTouched)
	end
end

for _, part in CollectionService:GetTagged("KillBrick") do
	setup(part)
end
CollectionService:GetInstanceAddedSignal("KillBrick"):Connect(setup)

The script connects the same function to every tagged part, including parts tagged while the game runs. Setting Health to 0 kills the character, and the health check stops it from firing again on a body that is already down.

Checkpoints and a Stage leaderstat

Set up the Checkpoints folder

Make a Folder named Checkpoints in Workspace. Add one flat, anchored part per stage and name them 1, 2, 3 and so on, with 1 at the start beside your SpawnLocation. Rotate each one so its front faces the next stage, because players respawn facing that way.

The checkpoint script

ScriptServerScriptService
-- Script in ServerScriptService: Stage in leaderstats, checkpoint touches and respawning at your stage
local Players = game:GetService("Players")

local checkpoints = workspace:WaitForChild("Checkpoints")

local function onCharacterAdded(player, character)
	local stage = player:WaitForChild("leaderstats"):WaitForChild("Stage")
	local checkpoint = checkpoints:FindFirstChild(tostring(stage.Value))
	if checkpoint then
		character:WaitForChild("HumanoidRootPart")
		task.wait() -- let the normal spawn finish first
		character:PivotTo(checkpoint.CFrame + Vector3.new(0, 4, 0))
	end
end

local function onPlayerAdded(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	local stage = Instance.new("IntValue")
	stage.Name = "Stage"
	stage.Value = 1
	stage.Parent = leaderstats
	leaderstats.Parent = player

	player.CharacterAdded:Connect(function(character)
		onCharacterAdded(player, character)
	end)
	if player.Character then
		task.spawn(onCharacterAdded, player, player.Character)
	end
end

for _, checkpoint in checkpoints:GetChildren() do
	local number = tonumber(checkpoint.Name)
	if number and checkpoint:IsA("BasePart") then
		checkpoint.Touched:Connect(function(hit)
			local player = Players:GetPlayerFromCharacter(hit.Parent)
			local stats = player and player:FindFirstChild("leaderstats")
			if stats and number == stats.Stage.Value + 1 then
				stats.Stage.Value = number
			end
		end)
	end
end

Players.PlayerAdded:Connect(onPlayerAdded)
for _, player in Players:GetPlayers() do
	task.spawn(onPlayerAdded, player)
end

When a player joins, the script makes a leaderstats folder with a Stage value, which Roblox shows in the player list (the leaderboard guide covers leaderstats in depth). Touching checkpoint 5 only counts when the player is on stage 4, so nobody skips ahead through a shortcut. Each time a character spawns, the script moves it on top of the checkpoint for its stage.

Save each player's stage

Without saving, everyone starts over when they rejoin, and long obbies lose players fast. This script loads the stage on join and saves it on leave and when the server shuts down:

ScriptServerScriptService
-- Script in ServerScriptService: loads and saves each player's Stage
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")

local store = DataStoreService:GetDataStore("ObbyStage")
local loaded = {}

local function onPlayerAdded(player)
	local stage = player:WaitForChild("leaderstats"):WaitForChild("Stage")
	local ok, saved = pcall(function()
		return store:GetAsync("stage_" .. player.UserId)
	end)
	if not ok then
		warn("Could not load the stage for " .. player.Name)
		return
	end
	if not player.Parent then return end -- left while loading
	loaded[player] = true
	saved = tonumber(saved)
	if saved and saved > stage.Value then
		stage.Value = saved
		player:LoadCharacter() -- respawn at the saved checkpoint
	end
end

local function save(player)
	if not loaded[player] then return end
	local stage = player.leaderstats.Stage.Value
	local ok, err = pcall(function()
		store:UpdateAsync("stage_" .. player.UserId, function(old)
			return math.max(tonumber(old) or 1, stage)
		end)
	end)
	if not ok then
		warn("Could not save the stage for " .. player.Name .. ": " .. tostring(err))
	end
end

Players.PlayerAdded:Connect(onPlayerAdded)
for _, player in Players:GetPlayers() do
	task.spawn(onPlayerAdded, player)
end

Players.PlayerRemoving:Connect(function(player)
	save(player)
	loaded[player] = nil
end)

game:BindToClose(function()
	for _, player in Players:GetPlayers() do
		task.spawn(save, player)
	end
	task.wait(3)
end)

The save uses UpdateAsync and keeps whichever stage is higher, so a stale server can never push a player back. When the saved stage is ahead, LoadCharacter respawns the player at their checkpoint.

Every DataStore call sits in pcall because requests can fail. If a load fails, the script never saves for that player, so a bad load can't wipe their progress. For retries and saving several values at once, read the DataStore tutorial.

Moving and disappearing platforms

If you tween an anchored platform, it slides out from under the player, because a part moved that way has no physics velocity for the character to ride. The fix is to unanchor the platform and let an AlignPosition hold it on a target that the tween moves. Tag these parts MovingPlatform and, in the Attributes section of Properties, give them an Offset (a Vector3, how far they travel) and optionally Seconds:

ScriptServerScriptService
-- Script in ServerScriptService: parts tagged "MovingPlatform" glide back and forth and carry players
local CollectionService = game:GetService("CollectionService")
local TweenService = game:GetService("TweenService")

local function setup(platform)
	local offset = platform:GetAttribute("Offset") or Vector3.new(0, 0, 16)
	local seconds = platform:GetAttribute("Seconds") or 3
	local start = platform.Position

	local attachment = Instance.new("Attachment")
	attachment.Parent = platform

	local align = Instance.new("AlignPosition")
	align.Mode = Enum.PositionAlignmentMode.OneAttachment
	align.Attachment0 = attachment
	align.Position = start
	align.RigidityEnabled = true
	align.Parent = platform

	local level = Instance.new("AlignOrientation")
	level.Mode = Enum.OrientationAlignmentMode.OneAttachment
	level.Attachment0 = attachment
	level.CFrame = platform.CFrame
	level.RigidityEnabled = true
	level.Parent = platform

	platform.Anchored = false
	platform:SetNetworkOwner(nil)

	local info = TweenInfo.new(seconds, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true)
	TweenService:Create(align, info, { Position = start + offset }):Play()
end

for _, platform in CollectionService:GetTagged("MovingPlatform") do
	setup(platform)
end
CollectionService:GetInstanceAddedSignal("MovingPlatform"):Connect(setup)

The two constraints hold the platform rigidly on its target and keep it level, and the tween slides the target back and forth forever (a repeat count of -1 with reverses on). SetNetworkOwner(nil) keeps the physics on the server, so the platform moves the same for everyone. Keep each moving platform a single part that isn't welded to anything anchored.

Disappearing platforms only need a tween. Tag them FadingPlatform:

ScriptServerScriptService
-- Script in ServerScriptService: parts tagged "FadingPlatform" vanish shortly after a player lands on them
local CollectionService = game:GetService("CollectionService")
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")

local FADE = TweenInfo.new(0.5)

local function setup(part)
	local busy = false
	local solid = part.Transparency
	part.Touched:Connect(function(hit)
		if busy or not Players:GetPlayerFromCharacter(hit.Parent) then return end
		busy = true
		task.wait(0.4) -- a moment to react
		local fade = TweenService:Create(part, FADE, { Transparency = 1 })
		fade:Play()
		fade.Completed:Wait()
		part.CanCollide = false
		task.wait(2)
		part.CanCollide = true
		TweenService:Create(part, FADE, { Transparency = solid }):Play()
		busy = false
	end)
end

for _, part in CollectionService:GetTagged("FadingPlatform") do
	setup(part)
end
CollectionService:GetInstanceAddedSignal("FadingPlatform"):Connect(setup)

After a short pause the platform fades out, stops being solid, waits two seconds and fades back. The busy flag stops a second touch from restarting the cycle halfway.

A finish line with a run timer

Put a part named Finish at the end. The server stamps each run's start with workspace:GetServerTimeNow(), which reads the same on the server and every client:

ScriptServerScriptService
-- Script in ServerScriptService: starts each player's run timer and stops it at the Finish part
local Players = game:GetService("Players")

local finish = workspace:WaitForChild("Finish")
local lastStage = #workspace:WaitForChild("Checkpoints"):GetChildren()

local function startRun(player)
	player:SetAttribute("RunStart", workspace:GetServerTimeNow())
end

Players.PlayerAdded:Connect(startRun)
for _, player in Players:GetPlayers() do
	startRun(player)
end

finish.Touched:Connect(function(hit)
	local player = Players:GetPlayerFromCharacter(hit.Parent)
	local stats = player and player:FindFirstChild("leaderstats")
	if not stats or player:GetAttribute("RunTime") or stats.Stage.Value < lastStage then
		return
	end
	local seconds = workspace:GetServerTimeNow() - player:GetAttribute("RunStart")
	player:SetAttribute("RunTime", seconds)
	print(string.format("%s finished in %.2f seconds", player.Name, seconds))
end)

The finish only counts when the player's stage is the last checkpoint, which blocks anyone who glitched past a stage. This is also the place to award a badge or a win.

To show the clock, add a ScreenGui to StarterGui with a TextLabel named Timer, then put this LocalScript inside the ScreenGui:

LocalScriptScreenGui
-- LocalScript inside a ScreenGui in StarterGui, next to a TextLabel named Timer
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer
local label = script.Parent:WaitForChild("Timer")

RunService.Heartbeat:Connect(function()
	local start = player:GetAttribute("RunStart")
	if not start then return end
	local seconds = player:GetAttribute("RunTime") or workspace:GetServerTimeNow() - start
	label.Text = string.format("%d:%05.2f", math.floor(seconds / 60), seconds % 60)
end)

The client only displays attributes the server set, so nobody can edit their own time. A returning player's clock starts when they join, so if you build a best-times board, only count runs that began at stage 1.

Playtest like a new player

Press Play (F5) and run the whole obby after every change, not just the stage you edited. Then check that:

  • No checkpoint sits within reach of a kill brick, so nobody respawns into a death.
  • Each new obstacle appears once on its own before it is combined with others.
  • Moving and fading platforms behave with two players on them. The Test tab can start a local server with several players.
  • The Output window shows no red errors after a full run.

Try at least one run on a phone, too, because touch players jump with an on-screen button and tight jumps feel harder. Then watch a friend play without helping: the stage where they die three times in a row is the one to fix. Revix can also run playtests for you, read the Output and fix the scripts that break.

Questions

How do you make a checkpoint in a Roblox obby?

Put numbered parts in a Checkpoints folder and use one server script that raises the player's Stage value when they touch the next checkpoint. When their character spawns, move it to the checkpoint that matches their stage. Save the Stage value in a DataStore so it survives rejoining.

How do you make a kill brick in Roblox?

Tag the part KillBrick and run one server script that sets the touching character's Humanoid Health to 0. CollectionService finds every tagged part, so a single script handles hundreds of kill bricks and you change their behavior in one place.

How many stages should an obby have?

There is no rule. A short obby with a good difficulty curve beats a long one full of repeats. Start with 20 to 30 strong stages, watch where players quit, and add more once those work.

Why do players slide off my moving platform?

A platform moved by tweening its position has no physics velocity, so the character is not carried along. Unanchor it, hold it with an AlignPosition whose target you tween, and give the server network ownership so players ride it smoothly.

Can I make an obby without scripting?

You can build the platforms without code, but kill bricks, checkpoints and saving all need short scripts. The scripts in this guide are ready to paste, or you can describe the obby to Revix and it writes and wires them in Studio for you.

Your game is
one sentence away.

Start building free

Free to start. No card needed.