Overview
Most beginner experiences need at least one on-screen button: play, shop, or codes. Roblox UI lives under StarterGui as ScreenGui objects that clone to each player’s PlayerGui.
This guide stays in educational territory: structure, anchors, and a LocalScript click handler. No free Robux UIs, no fake shop overlays.
Related: Scripting basics · Studio setup · Codes redeem tips
Steps
- 1
Insert a ScreenGui under StarterGui
In Explorer, open StarterGui → insert ScreenGui. Name it MainGui. Insert a Frame as a panel, then a TextButton inside the Frame. Set BackgroundTransparency and text so the button is readable on both light and dark maps.
- 2
Anchor and size with Scale
Prefer Scale over Offset for position/size so the UI survives phone screens. Use AnchorPoint (0.5, 0.5) when centering. Preview with the device emulator in Studio rather than guessing.
- 3
Add a LocalScript for the click
Insert a LocalScript under the TextButton. Connect MouseButton1Click (or Activated) to a function that prints a message or toggles another Frame visible. Keep UI logic on the client; never trust the client alone for currency or inventory.
- 4
Test on multiple aspect ratios
Play Solo, then switch emulator sizes (phone, tablet, desktop). Fix clipping before you add animations or shops. Accessibility: keep contrast high and tap targets large enough for thumbs.
Tips
- Use UICorner and UIPadding for cleaner buttons without messy Part-based menus.
- Group related controls in one Frame so you can tween the whole panel later.
- Disable ResetOnSpawn on ScreenGuis that should persist across character respawns when appropriate.
- Do not put secret codes or admin passwords in LocalScripts — players can read them.
FAQ
- Why doesn’t my button appear in-game?
- Common causes: ScreenGui not under StarterGui, Enabled false, ZIndex buried, or you tested a different place file than the one you edited.
- Should shops use ServerScripts?
- UI clicks start on the client, but purchases and inventory changes must be validated on the server with RemoteEvents/RemoteFunctions.
Shop on Mystery Market
Full catalog →Pay with card or Robux — no Discord account required.