BuildGUI Open maker

Template

Roblox HUD template

A top-of-screen stats bar — coins, level, timer — laid out with UIListLayout so pills space themselves no matter how many you add.

ScreenGui › HudFrame › Stat1..Stat3 · UIListLayout + UIPadding + UICorner

A HUD (heads-up display) is the strip of numbers a player sees while they play: coins, health, level, a timer. Because it sits on top of the game the whole session, it is the GUI players look at most — and the one that breaks most often on different screen sizes.

What this template builds

The code creates one ScreenGui that survives respawns, then a Frame pinned to the top of the screen. Inside it, a UIListLayout runs horizontally so each stat pill sits next to the last one, and UIPadding keeps the pills off the screen edge. Every pill is a TextLabel with a UICorner whose radius is half of the panel radius, so the bar looks deliberate rather than boxy.

local screenGui = Instance.new("ScreenGui")
screenGui.Name = "BuildGUIHud"
screenGui.ResetOnSpawn = false
screenGui.Parent = playerGui

local panel = Instance.new("Frame")
panel.Name = "HudFrame"
panel.AnchorPoint = Vector2.new(0.5, 0)
panel.Position = UDim2.fromScale(0.5, 0.04)
panel.Size = UDim2.fromScale(0.64, 0.18)
panel.BackgroundColor3 = Color3.fromRGB(24, 27, 33)
panel.BorderSizePixel = 0
panel.Parent = screenGui

local list = Instance.new("UIListLayout")
list.FillDirection = Enum.FillDirection.Horizontal
list.Padding = UDim.new(0, 8)
list.VerticalAlignment = Enum.VerticalAlignment.Center
list.Parent = panel

Why it uses a list layout instead of fixed positions

Hard-coded Position values are the reason HUDs break on phones. With UIListLayout, the engine stacks the pills itself: add a fourth stat and the bar grows, remove one and the gap closes. UIPadding on the left and right keeps the row from touching the screen edge without you calculating offsets.

Making it live data

This template stops at a visible bar. To make it show real numbers, keep a reference to each pill and update its Text from a script:

local coins = panel:WaitForChild("Stat1")
coins.Text = "Coins " .. tostring(player.leaderstats.Coins.Value)

Two habits save trouble later: give every pill a readable Name (Coins, Level, Time) instead of Stat1, and format numbers with string.format so the text width does not jump around as values change.

Common mistakes

  • Forgetting ResetOnSpawn. By default the GUI is destroyed when the player respawns; the HUD disappears and never comes back. Set screenGui.ResetOnSpawn = false.
  • Parenting before configuring. Set Parent last. If you parent first, listeners can fire on a half-built instance.
  • Using Offset for everything. Offset sizes break on small screens. Use fromScale for the panel and fromOffset only for small fixed things like pill height.
  • No padding. A bar flush against the top-left corner reads as a bug, not a style.

Where to go next

Open the GUI maker, pick HUD bar and set your accent colour to get the full version of this code with your own colours. If you want a shop or inventory panel instead, those are the other templates on this site.