§ How to · with Forge AI
How to make a Roblox obby (with AI)
A Roblox obby needs three things: stages with checkpoints, a respawn-on-fall system, and a win sequence. Forge AI generates a 15-stage obby with all three in 51 seconds — including the kill bricks and a stage counter HUD.
8 files · 210 lines · 51 seconds · 1 credit. Drop in, press Play, jump.
Stage builder
15 numbered stages spaced 30 studs apart, each with a checkpoint Part at the end. Configurable count and spacing.
Checkpoints
Touched event sets the player's RespawnLocation to the latest checkpoint reached. Survives death, persists across the round.
Kill bricks
Touched-event Parts that kill the player on contact. Color-coded red, tagged by Attribute so Forge knows what to spawn.
Win sequence
Final stage triggers a CFrame teleport to the win zone, fires a confetti VFX, and writes to a leaderstats win counter.
Stage counter UI
TextLabel HUD that updates 'Stage 7/15' as the player crosses each checkpoint.
Respawn handling
Death triggers respawn at the last checkpoint Position, not the lobby. CharacterAdded re-applies the stage HUD.
Files Forge AI ships for this prompt
8 files · 210 lines · 51 seconds · 1 credit
ServerScriptService/ObbyServer.lua
Checkpoint touch handler + RespawnLocation setter
78 lines
ServerScriptService/StageBuilder.lua
Generates 15 stages from a template at workspace startup
56 lines
ServerScriptService/WinHandler.lua
Win zone touch → leaderstats win + VFX
22 lines
ReplicatedStorage/StageTemplate
Cloneable stage Model
instance
ReplicatedStorage/Remotes/StageUpdate
Server → client stage HUD update
instance
StarterGui/StageHUD.lua
TextLabel showing Stage X/15
24 lines
StarterGui/WinScreen.lua
Confetti + restart button modal
18 lines
StarterPlayer/StarterPlayerScripts/ObbyClient.lua
RemoteEvent listener for HUD updates
12 lines
Sample output: ServerScriptService/ObbyServer.lua
--!strict
-- ServerScriptService/ObbyServer.lua (Forge AI · excerpt)
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StageUpdate = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("StageUpdate")
local function setupCheckpoints()
for _, checkpoint in ipairs(Workspace.Stages:GetChildren()) do
if checkpoint:GetAttribute("StageNumber") then
checkpoint.Touched:Connect(function(hit)
local player = Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
local stage = checkpoint:GetAttribute("StageNumber")
local current = player:GetAttribute("Stage") or 0
if stage > current then
player:SetAttribute("Stage", stage)
player.RespawnLocation = checkpoint
StageUpdate:FireClient(player, stage)
end
end)
end
end
end
setupCheckpoints()Building a Roblox obby
Obby is the fastest-shipping Roblox genre — players judge it on the first stage. The three things that decide whether they keep playing: clean checkpoint behaviour (no checkpoint loss on death), a stage HUD that updates instantly, and kill bricks that read as kill bricks (color-coded). Forge AI builds all three.
The Forge AI obby uses RespawnLocation as the checkpoint mechanic. When a player touches a checkpoint with a higher StageNumber than their current attribute, the server sets RespawnLocation to that checkpoint and fires a HUD update to the client. On death, Roblox respawns the player at RespawnLocation natively — no custom respawn script, no edge cases.
The StageBuilder script generates 15 stages from a template Model at workspace startup. The spacing is configurable (30 studs default) and the count is a top-of-file constant. To re-skin the obby, edit the template in ReplicatedStorage and the builder picks up the new visuals on next run.
The stage HUD is a single TextLabel that listens to a RemoteEvent. Server fires the event when a checkpoint is reached; client updates 'Stage 7/15'. Pooled, no GUI churn. The win screen is a separate RemoteEvent that fires once on the final checkpoint — confetti VFX, restart button, leaderstats write.
See more on the Luau generator, the game builder, or browse the full blog.
Frequently asked
Can I change the stage count from 15 to 30 (or more)?+
Yes. The stage count and spacing are top-of-file constants in StageBuilder.lua. Forge can also regenerate with a different count via a follow-up prompt.
Do checkpoints survive player death?+
Yes. The checkpoint sets RespawnLocation, so death respawns the player at the latest checkpoint reached. The stage HUD restores via CharacterAdded.
What about kill bricks?+
Forge generates color-coded kill bricks (red by default) that fire :BreakJoints() on touch. Tagged with an Attribute so the system knows which Parts kill.
Can I add a leaderboard for fastest completion?+
Yes. WinHandler writes to leaderstats on completion. Add a DataStore-backed top-10 leaderboard in a follow-up prompt.
Does it work with VIP zones or shortcuts?+
Yes. Add a gamepass check in WinHandler to teleport gamepass owners past stage 5 (or any stage). Forge wires the gamepass ID you provide.