§ How to · with Forge AI
How to make a Roblox checkpoint system (with AI)
By Sametcan Tasgiran, Founder & Developer·Published ·Updated
A Roblox checkpoint system needs four pieces: touch-activated parts, RespawnLocation updates, progress UI, and persistent save state. Forge AI generates all four in 36 seconds — works for obbies, races, and parkour maps.
4 files · 140 lines · 36 seconds · 1 credit. RespawnLocation-based, no custom respawn script needed.
Touch-activated checkpoints
Any Part tagged 'Checkpoint' with a CheckpointNumber attribute. Touching it sets your RespawnLocation. Crossing the same checkpoint twice has no effect.
Progress HUD
Top-center counter showing 'Checkpoint X / TOTAL'. Updates instantly on checkpoint hit. Optional segment timer for speedrun mode.
Persistent save
Last checkpoint reached is saved to DataStore. Player who rejoins is teleported to their saved checkpoint, not the lobby.
Skip prevention
Checkpoints validate sequence — touching Checkpoint 5 when your saved is 2 only counts if you also touched 3 and 4. Skipping (e.g., teleport exploit) is detected.
Win sequence trigger
Touching the final checkpoint fires a server-side win event. Optional fireworks VFX, win UI, leaderboard write.
Per-stage timer
Optional mode that records time from previous checkpoint to current. Used by speedrun-style maps. Saved alongside checkpoint state.
Files Forge AI ships for this prompt
4 files · 140 lines · 36 seconds · 1 credit
ServerScriptService/CheckpointManager.lua
Touch handler, RespawnLocation update, skip prevention
64 lines
ServerScriptService/CheckpointSaveService.lua
DataStore per-player progress
28 lines
ReplicatedStorage/Remotes/CheckpointHit
Server → client HUD update
instance
StarterGui/CheckpointHUD.lua
Counter + optional segment timer
38 lines
Sample output: ServerScriptService/CheckpointManager.lua
--!strict
-- ServerScriptService/CheckpointManager.lua (Forge AI · excerpt)
local Players = game:GetService("Players")
local CollectionService = game:GetService("CollectionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CheckpointHit = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("CheckpointHit")
local SaveService = require(script.Parent.CheckpointSaveService)
type State = { current: number, segmentStart: number }
local progress: { [Player]: State } = {}
local function setup()
for _, part in ipairs(CollectionService:GetTagged("Checkpoint")) do
local n = part:GetAttribute("CheckpointNumber") :: number
if not n then continue end
part.Touched:Connect(function(hit)
local player = Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
local p = progress[player] or { current = 0, segmentStart = os.clock() }
-- Sequence enforcement
if n ~= p.current + 1 then return end
local segmentTime = os.clock() - p.segmentStart
p.current = n
p.segmentStart = os.clock()
progress[player] = p
player.RespawnLocation = part
SaveService:Set(player, p.current)
CheckpointHit:FireClient(player, n, segmentTime)
end)
end
end
setup()Building a Roblox checkpoint system
Checkpoint systems are the difference between a frustrating obby and a fun one. The right pattern keeps players moving forward; the wrong pattern punishes them for not finishing in one session. Forge AI ships the forward-momentum version.
The Forge AI checkpoint prompt produces a 4-file system in 36 seconds. The core pattern uses Roblox's native RespawnLocation property — touching a checkpoint sets the player's RespawnLocation to that part. Death respawns them there, automatically. No custom respawn script, no edge cases.
Skip prevention is the underrated feature. Touching Checkpoint 5 when your last was 2 is rejected — you must touch 3 and 4 first. This is anti-exploit by design: teleport exploits can move the character but cannot bypass the sequence. The check is two lines of code (n == current + 1) and catches the most common cheat without needing a dedicated anti-exploit pass.
Persistent save flow is what turns the system from a session toy into a real game mechanic. Players who quit at Checkpoint 8 rejoin at Checkpoint 8. The save happens on every checkpoint hit, so even crashes lose at most one segment of progress. The DataStore key is per-place, so a player can have separate progress on different maps without conflict.
The segment timer is the speedrun layer. Each checkpoint records the time since the previous one. Speedrun maps display per-segment splits and total time. Persistent best times can be written to a separate 'BestTimes' DataStore on the win checkpoint — Forge wires this in 5 seconds with a follow-up prompt.
See more on the Luau generator, the game builder, or browse the full blog.
Frequently asked
Why use RespawnLocation instead of a custom respawn?+
RespawnLocation is the native Roblox property. Setting it tells Roblox to respawn the player at that location on death — no custom respawn code needed, no edge cases to handle. The fewer custom mechanics, the fewer bugs.
How does skip prevention work?+
Each checkpoint requires the previous one to have been touched. Touching Checkpoint 5 when your saved progress is 2 is rejected — the player must touch 3, then 4, then 5. This catches teleport exploits without explicit anti-exploit code.
Can I have multiple parallel paths (left or right)?+
Yes. Use CheckpointNumber with a path prefix (1A, 1B for left vs right). The validation logic compares numeric parts only, so both paths progress identically. Forge can extend with a branching path prompt.
What about a win counter on the win checkpoint?+
The final checkpoint writes a 'wins' counter via leaderstats:FindFirstChild('Wins').Value += 1. Stored alongside cash/level in your main DataStore. Forge wires this if you have a leaderboard system.
Does the segment timer survive disconnects?+
No — segment timers are for in-session speedrunning. The overall checkpoint progress is saved across sessions, but the segment-by-segment time tracking resets on rejoin. For persistent best times, write to a separate 'BestTimes' DataStore on win.