FFORGE

Tutorial · 10 min read · Updated November 2026

How to make a Roblox racing game with AI, step by step

Racing games on Roblox live or die on three things: cars that feel responsive, laps that cannot be cheated, and a race loop that never stalls when someone leaves. This sequence builds all three inside your own Studio, with the physics on the driver's client where it belongs and the laps, timers and rewards on the server where they belong. Written for Forge; the prompts work with any agent that can act in Studio.

Before you start

Message 1: the track and checkpoints

Build a racing track: a looped road of anchored parts with banked corners, 8 ordered
Checkpoint parts tagged with an Index attribute, a Start line and a 3-lap race. The server
tracks each player's next checkpoint so laps only count in order, records lap times with
os.clock, and runs a 3-2-1 countdown before the race starts. Show lap, position and lap time
on the HUD. Playtest with a basic test vehicle and screenshot the start line.

What to check: drive through the checkpoints out of order and confirm the lap does not count. Checkpoints are tagged parts, so you can reshape the track in Studio by moving them. This step has its own prompt page: Racing track with checkpoints and laps.

Message 2: cars and the garage

Add vehicles: find a drivable car on the Creator Store (verified creator, read its scripts
before keeping it), store it in ServerStorage.Vehicles and make 3 variants with different
MaxSpeed and Torque. A spawn pad per player spawns the selected car, sets its network owner
to that player, removes their previous car, and despawns it when they leave. A Garage screen
from the ForgeUI library picks a car (cash price for the second and third, checked on the
server). Playtest, spawn a car, drive 10 seconds, screenshot.

Forge inspects Store models before using them, which is the step most free-model racing kits skip; it is where backdoors hide. If the handling feels wrong, say "more grip" or "slower top speed" and Forge changes the attributes rather than the model.

Message 3: the race loop

Add a RoundManager: Lobby (wait for 2 players, 1 in Studio), Grid 10 s (spawn cars on the
grid, controls locked), Countdown 3 s, Race until everyone finishes or 60 s after the winner,
Results 8 s, then back to the lobby. Phase and TimeLeft live in ReplicatedStorage.RoundState
and the HUD reads them. Players who leave mid-race are dropped from the race table. Late
joiners spectate from the leader's car. Playtest alone and screenshot the grid.

One script owns the loop; everything else listens. That is what keeps a race game from stalling when the last player leaves during a countdown.

Message 4: results, podium and the best-lap board

On Results show a card with finishing order, lap times and coin rewards (1st 300, 2nd 200,
3rd 100, others 50) granted through the economy module. Teleport the top three to a podium
for 8 seconds with a camera cut, then return everyone to the lobby. Save best laps and write
them to an OrderedDataStore; a SurfaceGui board in the lobby shows the global top 10 best
laps, refreshed every 60 seconds with cached names. Screenshot the podium.

Rewards are granted after Results only, so leaving early forfeits them. The board refreshes once a minute to stay inside DataStore request budgets. Prompt page: Race results, podium and best-lap leaderboard.

Message 5: car unlocks and saving

Add saving with ProfileStore (one PlayerData module, session locked, template with Coins,
Cars, SelectedCar, BestLaps, PurchaseIdCache). Add two developer products that unlock the
second and third car instantly, through one ProcessReceipt in ServerScriptService.Monetization
that records the PurchaseId in the saved data before returning PurchaseGranted. Placeholder
ids with a TODO. Show real prices from GetProductInfo in the garage. Test with a Studio test
purchase and a rejoin.

Keep the cash path to every car. Instant unlock for Robux next to a cash price is the pattern Forge's monetization playbook recommends; a car that is Robux-only is a pay-to-win review waiting to happen.

Message 6: phones and consoles

Check the race on the iPhone and console presets: on-screen steering and throttle buttons
on touch, gamepad driving, the HUD scale-based with CoreUISafeInsets and nothing in the
bottom corners, the garage and results cards navigable with a controller. Screenshot both
presets and list what you changed.

What it costs

About 2,500 to 5,000 credits ($25 to $50) on Sonnet 5.5 for the six messages, more if you iterate on handling. The $25 pack covers a lean run, the $60 pack a careful one with polish. Ranges per step and the optional membership are on the pricing page.

Publishing checklist

  1. Create the two unlock products on the Creator Dashboard and paste the ids.
  2. Race with two clients (Test ▸ Clients and Servers) and confirm positions and rewards agree on both.
  3. Set the genre to Racing, write a description that names the track count and the cars, make an icon that reads at 150×150.
  4. Publish private, race on your phone, then publish public.

Questions

Can players cut the track?

Only by passing every checkpoint in order, which is what a lap is. The server tracks each player's next checkpoint index, so driving backwards through the finish line counts for nothing. Add more checkpoints on long straights if you find a shortcut.

Why does the driver own the car's physics?

Roblox physics is simulated by whoever owns the network ownership of the parts. Giving it to the driver makes steering feel instant. The server still owns laps, times, positions and rewards, which is what matters for fairness.

Where do the cars come from?

Forge searches the Creator Store for a drivable vehicle from a verified creator, reads its scripts before keeping it, and makes variants by changing attributes. You can also drop your own car model into ServerStorage.Vehicles and tell Forge its name.

How much does it cost?

The six messages run about 2,500 to 5,000 credits ($25 to $50) on Sonnet 5.5; the vehicle step is the one most likely to need a second pass. Every message shows its price first.

Related guides

Build the track in Forge. Pair your Studio, paste Message 1, get a screenshot of the start line back. Trial credits, no card. Build Message 1 in Forge →