Template · shop
Roblox shop GUI template
A copy-ready shop panel: six item cards in a scrolling grid, each with its own buy button. The Luau below is the exact output of the maker's Shop template.
What this shop template builds
A centred shop panel with a title, a close button, and a scrolling grid of six item cards. Each card has its own BUY button in your accent colour. The cards are placed by a UIGridLayout, so adding a seventh item does not mean nudging five frames by hand.
This is the script the Shop panel option in the Roblox GUI maker produces with the dark theme, an 8-pixel corner and the default green accent. Change those three settings and the same layout comes out in your colours.
The code
local panel = Instance.new("Frame")
panel.Name = "ShopPanel"
panel.AnchorPoint = Vector2.new(0.5, 0.5)
panel.Position = UDim2.fromScale(0.5, 0.5)
panel.Size = UDim2.fromScale(0.46, 0.6)
panel.BackgroundColor3 = Color3.fromRGB(24, 27, 33)
panel.BorderSizePixel = 0
panel.Parent = screenGui
local items = Instance.new("ScrollingFrame")
items.Name = "Items"
items.Position = UDim2.fromOffset(16, 46)
items.Size = UDim2.new(1, -32, 1, -62)
items.AutomaticCanvasSize = Enum.AutomaticSize.Y
items.ScrollBarThickness = 2
items.Parent = panel
local grid = Instance.new("UIGridLayout")
grid.CellSize = UDim2.fromOffset(96, 118)
grid.CellPadding = UDim2.fromOffset(8, 8)
grid.Parent = items
for i = 1, 6 do
local slot = Instance.new("TextButton")
slot.Name = "Slot" .. i
slot.LayoutOrder = i
slot.BackgroundColor3 = Color3.fromRGB(31, 36, 45)
slot.BorderSizePixel = 0
slot.Text = "Item " .. i
slot.Parent = items
local buy = Instance.new("TextButton")
buy.Name = "Buy"
buy.AnchorPoint = Vector2.new(0.5, 1)
buy.Position = UDim2.new(0.5, 0, 1, -8)
buy.Size = UDim2.fromOffset(72, 26)
buy.BackgroundColor3 = Color3.fromRGB(70, 214, 138)
buy.Text = "BUY"
buy.Parent = slot
end
That is the middle of the script — the full version the maker copies also creates the ScreenGui, the UICorner, the UIStroke and the title.
Making it a real shop
Add your items. Replace the for loop with an explicit list so each card has a name and a price:
local catalogue = { { name = "Speed", price = 100 }, { name = "Jump", price = 250 } }
for i, item in ipairs(catalogue) do
-- build the slot, set slot.Text = item.name
end
Hook up the button. The generated buy button does nothing yet. Inside the loop, capture the index and fire a remote:
buy.MouseButton1Click:Connect(function()
buyEvent:FireServer(catalogue[i].name)
end)
Then validate the purchase on the server — never trust a client that says it paid.
Add icons. Put an ImageLabel inside each slot, set Size to UDim2.fromScale(0.7, 0.55), anchor it to the top centre, and set Image to your decal's asset id. Keep BackgroundTransparency = 1 so the card colour shows through.
Sizes that hold up
The panel is 0.46 x 0.6 of the screen and the grid cells are fixed at 96 x 118 pixels. On a phone that means two columns; on a 1440p monitor it means four or five. If you want a fixed column count instead, swap CellSize for UIGridLayout with FillDirectionMaxCells, or use UIGridStyleLayout settings to force three per row.
If the cards look too small on mobile, raise the cell width to 120 and let the grid wrap — the ScrollingFrame already has AutomaticCanvasSize set, so the scroll height recalculates itself.
Related layouts
- Inventory GUI template — the same slot idea without prices
- Main menu template — the panel a player sees before the shop
- Open the maker to rebuild this with a different accent or corner
FAQ
Does this need a plugin? No. It is plain Luau you paste into the Command Bar or a LocalScript.
Will it break when Roblox updates? It only uses core GUI classes (ScreenGui, Frame, ScrollingFrame, UIGridLayout, TextButton, UICorner), which have been stable for years.
Can I use it in a paid game? Yes, the code is yours.