Blog / Walkthrough 4 min read

How to build a Roblox Shop, HUD, and Battle Pass UI with AI in 5 minutes

Step-by-step walkthrough for building a Roblox Shop, Simulator HUD, and Battle Pass ScreenGui with AI using match_theme, decide_screen, preview_units, compose_units, and execute_luau.

If you already have penui MCP and Roblox Studio MCP connected in Cursor, Claude Code, or Windsurf, building your core game screens takes minutes instead of an afternoon of dragging frames in Studio. Here is the exact 5-step tool sequence your agent uses to build a cohesive Shop, HUD, and Battle Pass in StarterGui.

Step 1: Pick one cohesive style with match_theme

Start by letting the agent map your game genre to a matching pack so your Shop, HUD, and Battle Pass belong to the same world:

// Tool: match_theme
{
  "prompt": "anime simulator with coin shop, potions HUD, and 4-tier battle pass",
  "screens": ["shop", "hud", "battlepass"],
  "creativity": "mixed"
}

match_theme returns recommended base packs and accent pairings—for example, stud-shop for a vibrant stud-textured storefront, ang3lz-hud or skibidifig (Simulator Screens) for HUD widgets, and season-pass or ang3lz-battlepass for progression tracks. Remember the core rule: stick to one base pack per screen for panels and headers.

Step 2: Draft the Shop layout with decide_screen

For a 1280x720 gamepass shop, call decide_screen with your item names and prices so it maps roles to real unit IDs and checks readability:

// Tool: decide_screen
{
  "prompt": "Gamepass shop with 4 boosts and a close button",
  "screen": "shop",
  "pack": "stud-shop",
  "width": 1280,
  "height": 720,
  "title": "BOOST SHOP",
  "items": [
    { "name": "2x Coins", "price": "199 R$" },
    { "name": "VIP Aura", "price": "399 R$" },
    { "name": "Auto Hatch", "price": "249 R$" },
    { "name": "Fast Walk", "price": "99 R$" }
  ]
}

decide_screen returns an editable compose_units payload plus any copy-length or contrast warnings. You can also inspect raw pieces directly with search_units (setting contact_sheet: true to view a numbered grid PNG).

Step 3: Verify visually for free with preview_units

Pass the draft (or your custom arrangement of units like stud-shop.main-3_2, stud-shop.shoptext-12_63, and stud-shop.x-button-12_62) into preview_units before uploading anything:

// Tool: preview_units (free)
{
  "name": "BoostShop",
  "width": 1280,
  "height": 720,
  "layout": "zones",
  "items": [
    { "id": "stud-shop.main-3_2", "role": "window" },
    { "id": "stud-shop.shoptext-12_63", "role": "header", "texts": ["BOOST SHOP"] },
    { "id": "stud-shop.x-button-12_62", "role": "close" }
  ]
}

Inspect the returned PNG. Check that the title fits the header ribbon, the close button sits cleanly in the top-right corner, and cards do not crowd each other. Adjust scale, x/y, or texts and re-run preview_units until clean.

Step 4: Stage art (or skip uploads with native mode)

You have two choices before compiling Luau:

Step 5: Compile with compose_units and run execute_luau

Call compose_units with the verified arguments. Check the script's top report for zero orphan, clipped, or mixed-packs errors, then pass the generated Luau directly to Roblox Studio MCP's execute_luau tool to spawn StarterGui.BoostShop.

Repeating the pattern for your HUD and Battle Pass

Frequently asked questions

How long does it take to build a Roblox Shop, HUD, and Battle Pass with penui?

Once penui MCP and Roblox Studio MCP are connected, generating and executing each ScreenGui takes a few tool calls—typically under 5 minutes for a shop, HUD, and battle pass workflow including free PNG layout previews.

Which penui packs are best for a Roblox Shop, HUD, and Battle Pass?

For shops, use stud-shop, wtever (Restock Shop), or the shop screens inside skibidifig (Simulator Screens). For HUDs, use ang3lz-hud, full-game-hud, or skibidifig. For battle passes, use season-pass or ang3lz-battlepass.

What is the difference between preview_units and compose_units?

They share the exact same input schema. preview_units is free and returns a rendered PNG and layout inspection report; compose_units is metered and outputs the production Luau ScreenGui script ready for execute_luau.

Does running execute_luau overwrite my existing ScreenGui cleanly?

Yes. Generated penui ScreenGui scripts replace any existing ScreenGui of the same name inside the target parent (default StarterGui), so iterating on a screen never leaves duplicate GUIs behind.

Install the MCP server · All posts · RSS feed