§ How to · with Picoo
How to make a main menu and loading screen in Roblox
By Sametcan Tasgiran, Founder & Developer·Published ·Updated
A Roblox main menu is a ScreenGui with a title, a few buttons and a script that gives each button a job. Ask Picoo for a main menu, start screen or title screen and it applies its menu_ui_kit recipe: the whole menu lands in StarterGui in Edit mode, and one LocalScript wires every button.
2 files · 38 lines · one recipe call: a 24-instance ScreenGui and the LocalScript that drives it. A loading screen is a follow-up prompt.
Built in Edit mode
The MainMenu ScreenGui is made of real instances in StarterGui, so it shows in Studio before you press Play and you can restyle, move or re-word any part of it.
Title and three buttons
A full-screen dark backdrop, a large title (MY GAME unless you name your game) and Play, Shop and Settings buttons with rounded corners in a centred column. Play uses the accent colour, emerald unless you ask for another.
Every button wired
One LocalScript, MenuController: Play hides the whole menu, Settings opens and closes the settings panel, Close hides it, and Shop prints a line to the Output window where your shop code goes.
Settings panel
A hidden panel with a Settings header, a Music ON/OFF toggle and a red Close button. The toggle flips its label and a musicOn flag in the script; linking it to your game's music is a follow-up prompt.
Survives respawn
ResetOnSpawn is false on the ScreenGui, so a death does not rebuild the menu, and once Play hides it, it stays hidden.
Covers the top bar
IgnoreGuiInset is true, so the backdrop also fills the strip behind Roblox's top bar, and DisplayOrder 10 draws the menu above ScreenGuis with a lower DisplayOrder.
Files Picoo ships for this prompt
2 files · 38 lines · one recipe call
StarterGui/MainMenu
ScreenGui, 24 instances in all: backdrop, title, the Play / Shop / Settings column with its list layout, and the hidden settings panel with the Music toggle and Close button.
instance
StarterGui/MainMenu/MenuController
LocalScript that wires the buttons: Play hides the menu, Settings and Close toggle the panel, Music flips its label, Shop prints a placeholder line.
38 lines
Sample output: StarterGui/MainMenu/MenuController
--!strict
-- Generated by Picoo recipe: menu_ui_kit — wires the MainMenu ScreenGui.
local gui = script.Parent
local backdrop = gui:WaitForChild("Backdrop")
local col = backdrop:WaitForChild("ButtonColumn")
local settings = backdrop:WaitForChild("SettingsPanel")
local play = col:WaitForChild("PlayButton") :: TextButton
local shop = col:WaitForChild("ShopButton") :: TextButton
local settingsBtn = col:WaitForChild("SettingsButton") :: TextButton
local musicToggle = settings:WaitForChild("MusicToggle") :: TextButton
local closeBtn = settings:WaitForChild("CloseButton") :: TextButton
-- Play → hide the whole menu so the game shows through. Other systems can
-- listen for this via gui:GetPropertyChangedSignal("Enabled").
play.Activated:Connect(function()
gui.Enabled = false
end)
settingsBtn.Activated:Connect(function()
settings.Visible = not settings.Visible
end)
closeBtn.Activated:Connect(function()
settings.Visible = false
end)
local musicOn = true
musicToggle.Activated:Connect(function()
musicOn = not musicOn
musicToggle.Text = "Music: " .. (musicOn and "ON" or "OFF")
end)
shop.Activated:Connect(function()
-- Placeholder hook: fire your shop here. Left as a print so the button is
-- clearly wired (not a dead button) without assuming a shop exists yet.
print("[MainMenu] Shop clicked")
end)Building a main menu and loading screen in Roblox
A main menu is the first thing a player sees, and hand-built menus tend to break in two ways: buttons with no handler behind them, and a GUI that vanishes the first time the player dies. Ask Picoo for a main menu and it builds one from a fixed recipe, menu_ui_kit, with a handler on every button and a ScreenGui set up to survive respawns.
The menu arrives as real instances in StarterGui, so you can see it in Studio's Edit mode before pressing Play. A full-screen backdrop sits behind a large title and a centred column of three buttons, Play, Shop and Settings, laid out by a UIListLayout with rounded corners on each. A settings panel with a Music toggle and a Close button waits, hidden, in the middle of the screen. It is all ordinary GUI objects, so restyling means selecting a frame and changing its properties.
The wiring is one LocalScript, MenuController, inside the ScreenGui. Play sets the ScreenGui's Enabled property to false, which hides the menu and lets the game show through; other scripts can listen for that change to start music, move the camera or show a HUD. Settings toggles the panel, Close hides it, and Music flips its label between ON and OFF. Shop prints a line to the Output window where your shop code will go.
Two properties on the ScreenGui do the quiet work. ResetOnSpawn is false, so a respawn does not destroy the menu and clone a fresh copy with its state lost, which is a common reason Roblox menus disappear or stop responding. IgnoreGuiInset is true, so the backdrop also covers the strip behind Roblox's top bar.
A loading screen is a separate piece and a follow-up prompt. It has to live in ReplicatedFirst, which reaches the client before the rest of the game, and call RemoveDefaultLoadingScreen there; a script in StarterPlayerScripts runs after Roblox's own screen has already gone. A scripted camera behind the menu, per-device UI scaling, a real soundtrack behind the Music toggle and a shop behind the Shop button are follow-up prompts too.
See more on the Luau generator, the AI Luau script writer, the 3D model generator and the game builder, read how Picoo compares with ChatGPT, or browse the full blog.
Frequently asked
What does Picoo build when I ask for a main menu?+
Two things in StarterGui: a MainMenu ScreenGui with 24 instances (backdrop, title, the Play, Shop and Settings column and a hidden settings panel) and a LocalScript inside it called MenuController that wires the buttons. It comes from the menu_ui_kit recipe, so the same settings build the same menu every time.
What do the buttons do?+
Play sets the ScreenGui's Enabled property to false, so the menu disappears and the game shows through; other scripts can listen for that change to start music or show a HUD. Settings opens and closes the settings panel and Close hides it. Music switches its own label between ON and OFF. Shop prints a line to the Output window to mark where your shop code goes. Linking Music to a real soundtrack and Shop to a real shop are follow-up prompts.
Why does my GUI disappear when I respawn?+
ScreenGui.ResetOnSpawn is true by default, so every respawn destroys the GUI and clones a fresh copy from StarterGui, and any state or connection on the old copy is gone. The MainMenu ScreenGui Picoo builds has ResetOnSpawn set to false, so it survives deaths and stays hidden after the player presses Play. Set the same property on any other GUI that should persist.
Can Picoo add a loading screen?+
Yes, in a follow-up prompt; the recipe builds the menu only. A custom loading screen has to run from ReplicatedFirst, which reaches the client before the rest of the game, and call ReplicatedFirst:RemoveDefaultLoadingScreen() there. The same code in StarterPlayerScripts runs too late to replace Roblox's own screen. For a progress bar that reflects real loading, preload assets with ContentProvider:PreloadAsync and advance the bar as each one finishes.
Will the menu fit on a phone?+
The backdrop fills the screen and the title is sized with Scale and TextScaled, so both adapt to the screen. The button column (360 × 220 pixels) and the settings panel (420 × 260) use fixed pixel sizes, centred horizontally. To scale them per device with a UIScale or a UIAspectRatioConstraint, ask in a follow-up prompt.
What if my game already has its own scripts and GUIs?+
The recipe is for a new or nearly empty place. In a place that already has your own systems, Picoo builds the menu piece by piece in your game's style instead of dropping in this template, so names and layout follow your game rather than this page.
Related Picoo prompts
lobby in Roblox Studio
It applies game_map, Picoo's map kit, whose default theme is this lobby hub: 10 scripts and 3,209 lines in one recipe call. A ready-up queue that teleports a group into a match is a separate system you add with a follow-up prompt.
custom camera in Roblox
Cameras are client-only, and every reliable camera in Roblox comes down to three things: the right CameraType, the right update event, and framerate-independent smoothing. Picoo's camera_system recipe writes one 135-line LocalScript that gets all three right.
Roblox shop system
8 files · 1,259 lines, 852 of them the shared PicooFeedback module · one recipe call. Three starter items by default; name your own items and prices in the prompt.