Blog / AI Game Creation 4 min read

Roblox game creation with AI: building production ScreenGui & game UI via MCP

How to pair an AI coding agent with Roblox Studio MCP and penui MCP for end-to-end Roblox game creation with AI—building shops, HUDs, inventories, battle passes, and rebirth menus in Luau.

AI coding agents have changed how solo developers and small teams ship Roblox games. Claude Code, Cursor, Windsurf, OpenAI Codex, Gemini CLI, Zed, and Antigravity already handle server-side DataStore persistence, RemoteEvent validation, combat loops, and module architecture in Luau. The bottleneck in Roblox game creation with AI has always been the client interface: StarterGui.

When an agent tries to invent a shop, battle pass, or simulator HUD using only text prompts, it writes hundreds of lines of guessed coordinates and flat Frame + UICorner boxes. Pairing your coding agent with two complementary MCP servers—Roblox Studio MCP for live Studio state and Luau execution, and penui MCP for deterministic Figma-extracted UI—closes that gap.

The 3-part stack for Roblox game creation with AI

End-to-end game UI workflow inside Studio

Instead of context-switching between Figma, image editors, Studio's Properties pane, and your IDE, your agent runs one repeatable loop for every screen in your game:

  1. Match the genre to one pack: Call match_theme or suggest_combos with your game's theme (simulator, anime-fighting, tycoon, RPG, tower defense). The agent selects one cohesive base pack—such as skibidifig (Simulator Screens), stud-shop, ang3lz-hud, season-pass, slots-anime, or rebirth-ui—so every window shares matching bevels, corners, and lighting.
  2. Draft and verify visually before Studio: Call decide_screen to map roles (window, header, close button, cards, icons, CTA buttons) onto real unit IDs, then call preview_units to render a PNG with your actual copy (item names, Robux prices, multipliers) and check for overlaps or clipped text.
  3. Choose native instances or uploaded art: Prototype immediately with zero uploads using native Frame + UICorner + UIGradient + UIStroke synthesis, or stage pixel-exact PNGs with upload_unit_assets + Studio upload_image + register_uploaded_assets.
  4. Compile and execute in StarterGui: Call compose_units or compose_screen to generate one scaled Luau script (with AutoScale UIScale and named container hierarchy), run it via execute_luau, and immediately wire your client LocalScripts to those named buttons and labels.

Wiring AI-built ScreenGuis to real gameplay Luau

Because compose_units and compose_screen emit a deterministic HIERARCHY tree at the top of every script—with predictable frame names, cloned repeat cards (REPEAT_OFFSETS), and separate TextLabels—your coding agent can inspect the generated hierarchy and write the client controller in the same turn:

-- Example: wiring a penui-generated shop card click to MarketplaceService
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local gui = Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("CoinShop")
local buyBtn = gui.MainPanel.Card_1.BuyButton

buyBtn.Activated:Connect(function()
    MarketplaceService:PromptGamePassPurchase(Players.LocalPlayer, 123456789)
end)

No fragile hardcoded paths, no flattened text baked into PNGs, and no manual re-exporting when you rename a currency or adjust a Robux price.

What stays deterministic vs. what your agent writes

Keep visual geometry, 9-slice SliceCenter math, glow padding (imageOrigin), and viewport scaling inside penui's compiler. Let your AI coding agent focus on what language models do best: state management, animations (TweenService), sound triggers, server-authoritative purchase checks, and responsive game feel.

Frequently asked questions

Can I use AI to build a complete Roblox game including the UI?

Yes. Pair an AI coding agent (Claude Code, Cursor, Windsurf, Codex, Gemini CLI, or Antigravity) with Roblox Studio MCP for gameplay Luau and penui MCP for deterministic ScreenGui creation. The agent writes server/client gameplay code and assembles shops, HUDs, inventories, battle passes, and rebirth menus directly in StarterGui.

How does penui connect to Roblox Studio MCP?

Both servers run side-by-side in your AI client's MCP configuration. Your agent uses penui to search units, preview PNG layouts, and compile Luau, then calls Roblox Studio MCP's upload_image (when using bitmap art) and execute_luau to place the ScreenGui into Studio.

What Roblox screens can penui build for AI game development?

penui covers shops (stud-shop, wtever, skibidifig), HUDs (full-game-hud, ang3lz-hud), battle and season passes (season-pass, ang3lz-battlepass), inventories and pet grids (slots-anime, indexx), rebirth menus (rebirth-ui), daily rewards, settings, and upgrade modals.

Do I have to upload images to prototype a Roblox game UI with AI?

No. Compatible categories (button, close-button, panel, header, tile, bar, input) compile cleanly to native Roblox Frame, UICorner, UIGradient, UIStroke, and TextLabel instances with zero image uploads, and you can upgrade any piece to uploaded pixel art later.

Install the MCP server · All posts · RSS feed