{"slug":"roblox-obby-game-prompt","niche":"roblox","lang":"en","title":"The canonical prompt for a Roblox obby game (full Luau architecture)","description":"A production prompt for a complete Roblox obby: checkpoint system with DataStore persistence, server-validated progress, stage-skip monetization, and mobile-friendly controls — with strict Luau and no client-trusted state.","spec":"A complete, publishable obby game: 20+ stages of graduated difficulty, checkpoint system persisted with ProfileService-style DataStore wrapping, server-side validation of all progress (no client-trusted teleports), leaderboard by stage, one developer product (skip stage) and one game pass (2x speed), loading screen gated on data load, works with touch controls.","prompt":"You are a senior Roblox developer with multiple front-page obby games. You write --!strict Luau, you never trust the client, and you know Roblox's moderation and monetization rules cold.\n\nBuild a complete obby game: [THEME — e.g. \"lava escape\", \"rainbow sky\"]. Target audience: [AGE RANGE]. Sessions should feel rewarding within 3 minutes.\n\nARCHITECTURE (generate every file, complete and runnable):\nServerScriptService/\n  GameManager.server.lua      -- stage registry, player state machine\n  CheckpointService.lua       -- ModuleScript: touch detection SERVER-SIDE, anti-teleport validation (max stage delta = 1)\n  DataService.lua             -- DataStore wrapper: session locking, retry with backoff, pcall on every call\n  MonetizationService.lua     -- ProcessReceipt for Skip Stage product; game pass check for 2x speed\nReplicatedStorage/\n  Remotes/                    -- RemoteEvents: StageReached, PurchasePrompt; RemoteFunction: GetLeaderboard\n  Config.lua                  -- stage count, respawn times, product IDs as named constants\nStarterPlayer/StarterPlayerScripts/\n  ClientController.client.lua -- respawn UI, stage counter HUD, purchase buttons\n  LoadingScreen.client.lua    -- shows until server fires DataLoaded\n\nHARD RULES:\n- --!strict in every file. Type every remote payload.\n- The client NEVER writes progress. Checkpoint touches are validated server-side: distance sanity check + stage order check (can only advance by 1).\n- Every DataStore call in pcall with 3 retries and exponential backoff. Save on checkpoint, on leave, and every 120s autosave.\n- ProcessReceipt is idempotent: check purchase history before granting, return Enum.ProductPurchaseDecision correctly in ALL branches.\n- Touch controls: no keyboard-only mechanics; jumps tuned for mobile (max gap = 12 studs at default speed).\n- Stage difficulty curve: stages 1-5 tutorial-easy, 6-15 ramping, 16+ hard; place a free checkpoint every stage.\n\nOUTPUT: every file as a separate code block with its exact path as the header. After the code, a 5-step Studio setup checklist (product IDs, DataStore API access, test procedure).\n\nVERIFY BEFORE OUTPUT: no client-authoritative state anywhere; every pcall has a failure branch; ProcessReceipt handles the retry-after-crash case.","whyItWorks":["Specifying the file tree turns 'make a game' into a bounded engineering task with checkable output.","Server-side checkpoint validation with a max-stage-delta rule blocks the #1 obby exploit (teleport hacking).","Explicit ProcessReceipt idempotency prevents the most common Robux-losing bug in monetized games.","Mobile constraints (12-stud gaps) reflect that ~75% of Roblox players are on touch devices."],"commonMistakes":["Client-side checkpoint detection — exploiters finish the obby in 10 seconds.","DataStore calls without pcall/retry — random progress wipes, 1-star reviews.","ProcessReceipt granting before checking history — duplicate grants on retry.","Jump distances tuned on desktop — mobile players physically cannot progress."],"keywords":["roblox obby prompt","roblox game prompt","luau obby script","roblox studio ai prompt"],"updated":"2026-07-18"}