How to make a shop GUI in Roblox Studio
A shop that scales from phone to PC, with item cards, a buy button and a server that checks every purchase. Built with ScreenGui, layouts and MarketplaceService.
On this page
A good shop is mostly layout and one rule: the client asks, the server decides. This guide builds a shop window with item cards that works on phones and PCs, and wires it to a server script that checks every purchase.
Lay out the window
- In StarterGui, add a ScreenGui called Shop. Turn on IgnoreGuiInset only if you want it under the top bar.
- Add a Frame called Window. Set its Size with Scale, not Offset, for example
{0.6, 0}, {0.7, 0}, and AnchorPoint to0.5, 0.5with Position{0.5, 0}, {0.5, 0}so it stays centred. - Add a UIAspectRatioConstraint so the window keeps its shape on tall phones.
- Add UICorner and UIStroke for rounded corners and an outline. Keep the stroke thin.
Item cards in a grid
- Inside Window, add a ScrollingFrame called Items. Set AutomaticCanvasSize to Y so it grows with the content.
- Add a UIGridLayout to Items. Use Scale for CellSize (for example
{0.3, 0}, {0, 0}) and a UIAspectRatioConstraint inside each card, so cards stay square. - Make one card as a template: an ImageLabel for the icon, a TextLabel for the name and a TextButton for the price. Turn on TextScaled with a UITextSizeConstraint so text never gets huge or tiny.
- Move the template into ReplicatedStorage. A LocalScript clones it once per item.
Item data lives in one place
Put a ModuleScript in ReplicatedStorage with every item: id, name, icon, price and the developer product or game pass ID. The client reads it to draw cards. The server reads the same module to decide what things cost, so a cheating client cannot change a price.
The buy button
When a card's button is clicked, the LocalScript sends only the item id to the server through a RemoteEvent. Never send the price.
On the server:
- Look the item up in the module. Unknown id: ignore it.
- For Robux items, call
MarketplaceService:PromptProductPurchasefor a developer product or for a pass.