Template · settings
Roblox settings GUI template
Three setting rows — music, sound effects, camera shake — with a pill toggle on each, generated as Luau you can paste straight into Studio.
What this settings template builds
A centred 0.44 x 0.44 panel with a Settings title and three rows stacked inside it: Music, Sound effects and Camera shake. Each row is a 40-pixel strip with the label on the left and a 44 x 22 pill button on the right.
The pill takes your accent colour and is fully rounded — UICorner.CornerRadius = UDim.new(1, 0) turns a rectangle into a capsule, which is why the toggle looks like a switch and not like a button with soft corners.
The rows are placed by a UIListLayout, not one by one, so a fourth setting is one more line in the list rather than a new position to work out.
The code
local panel = Instance.new("Frame")
panel.Name = "SettingsPanel"
panel.AnchorPoint = Vector2.new(0.5, 0.5)
panel.Position = UDim2.fromScale(0.5, 0.5)
panel.Size = UDim2.fromScale(0.44, 0.44)
panel.BackgroundColor3 = Color3.fromRGB(24, 27, 33)
panel.BorderSizePixel = 0
panel.Parent = screenGui
local list = Instance.new("UIListLayout")
list.Padding = UDim.new(0, 4)
list.SortOrder = Enum.SortOrder.LayoutOrder
list.Parent = panel
local pad = Instance.new("UIPadding")
pad.PaddingTop = UDim.new(0, 44)
pad.PaddingLeft = UDim.new(0, 16)
pad.PaddingRight = UDim.new(0, 12)
pad.PaddingBottom = UDim.new(0, 12)
pad.Parent = panel
for i, label in ipairs({ "Music", "Sound effects", "Camera shake" }) do
local row = Instance.new("Frame")
row.Name = label .. "Row"
row.LayoutOrder = i
row.Size = UDim2.new(1, -28, 0, 40)
row.BackgroundTransparency = 1
row.Parent = panel
local text = Instance.new("TextLabel")
text.Name = "Name"
text.BackgroundTransparency = 1
text.Size = UDim2.new(1, -56, 1, 0)
text.Font = Enum.Font.Gotham
text.TextSize = 14
text.TextXAlignment = Enum.TextXAlignment.Left
text.TextColor3 = Color3.fromRGB(230, 233, 239)
text.Text = label
text.Parent = row
local toggle = Instance.new("TextButton")
toggle.Name = "Toggle"
toggle.AnchorPoint = Vector2.new(1, 0.5)
toggle.Position = UDim2.new(1, 0, 0.5, 0)
toggle.Size = UDim2.fromOffset(44, 22)
toggle.BackgroundColor3 = Color3.fromRGB(70, 214, 138)
toggle.BorderSizePixel = 0
toggle.Font = Enum.Font.GothamBold
toggle.TextSize = 11
toggle.TextColor3 = Color3.fromRGB(10, 16, 12)
toggle.Text = "ON"
toggle.Parent = row
local toggleCorner = Instance.new("UICorner")
toggleCorner.CornerRadius = UDim.new(1, 0)
toggleCorner.Parent = toggle
end
That is the settings half of the script. The full version the maker copies also creates the ScreenGui, the panel's UICorner and UIStroke, the title label and the X close button.
Making the toggles do something
The generated pill says ON and stays ON — it is a layout, not a setting. To make each row switch, drop this inside the for loop, right after toggleCorner.Parent = toggle:
local on = true
toggle.MouseButton1Click:Connect(function()
on = not on
toggle.Text = on and "ON" or "OFF"
toggle.BackgroundColor3 = on and Color3.fromRGB(70, 214, 138) or Color3.fromRGB(52, 58, 70)
end)
label, on and toggle are brand-new locals every time the loop runs, so each button's handler closes over its own row. This is the reason the code uses ipairs with a local label instead of building one shared table and indexing it — with a shared table, all three handlers can end up pointing at the last row.
Hear something happen. Put every music track under a SoundGroup called Music and every effect under SFX in SoundService, then switch them by group instead of by individual sound:
local SoundService = game:GetService("SoundService")
SoundService.Music.Volume = on and 0.5 or 0
Remember the choice. The client should only change what it looks like locally; the saved value belongs on the server:
local setRemote = game:GetService("ReplicatedStorage"):WaitForChild("SetSetting")
setRemote:FireServer(string.lower(label), on)
On the server, validate the key against a whitelist and write it to a DataStore keyed by player.UserId. A client that can write its own settings row can also write MusicOn = false for everyone if you let it name the key unchecked.
How many rows fit
The three generated rows take 40 + 4 + 40 + 4 + 40 = 128 pixels, plus 44 of top padding. That is 172 pixels of content inside a panel that is 0.44 of the screen tall — on a 1080p monitor the panel is 475 pixels, so about 300 pixels of it sits empty below the last row.
Two ways out:
- Shrink the panel to
UDim2.fromScale(0.44, 0.3)if you keep three rows. On a 844-pixel-tall phone that is 253 pixels, still taller than 172, so it fits. - Add rows — Graphics quality, Vibration, Language.
UIListLayoutdoes not grow its parent, so adding rows means raising the height yourself; 40 pixels per row plus 4 of padding.
The row width is UDim2.new(1, -28, 0, 40), and 28 is exactly the left 16 plus the right 12 padding above it — that is why the rows line up flush with the panel edges without touching them.
Related layouts
Main menu template — the Settings button in that menu is where this panel usually opens from
Codes redeem template — the other small utility panel
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.
Can I add a volume slider? Roblox has no slider class. Build one from a Frame track plus a narrower fill Frame, connect InputBegan and InputChanged on the track, and read the position as (input.Position.X - track.AbsolutePosition.X) / track.AbsoluteSize.X, clamped to 0 and 1.
Why do all three toggles look the same? Because the generated code only draws them. The snippet above adds per-row state; nothing in the layout needs to change.
Can I use it in a paid game? Yes. The code is yours, no licence fee, no attribution.