Roblox ScreenGui Not Showing (Enabled = true) – Fix
The symptom
Your script prints that it is showing the GUI (or you set ScreenGui.Enabled = true), there is no error in Output, and nothing appears on screen. No error usually means the code ran fine, just against the wrong object, or something else hid the GUI again. Work through these causes in order.
1. ResetOnSpawn is on (the default)
Every ScreenGui in StarterGui is copied into PlayerGui each time the character spawns, and with ResetOnSpawn ticked the old copy is destroyed on respawn. If your script saved a reference once (local gui = playerGui.MyScreenGui at the top) and the player has died or respawned since, that variable points at a destroyed copy. Setting Enabled on it works without error, but it is no longer on screen.
Fix: untick ResetOnSpawn on the ScreenGui, or look the GUI up inside the event handler each time instead of caching it at the top of the script.
2. Two ScreenGuis with the same name
If PlayerGui contains two GUIs called the same thing (for example one from StarterGui and one cloned in by a script), FindFirstChild returns whichever comes first, and you may be enabling the wrong one. Press Play, then in Explorer open Players > your name > PlayerGui and check how many copies there are. Rename or remove the extra one.
3. The ScreenGui is enabled but its contents are hidden
Enabling the ScreenGui does not make its children visible. Check the Frame (and anything inside it) during Play:
Visibleis false on the Frame or a parent Frame.SizeisUDim2.new(0, 0, 0, 0), orBackgroundTransparencyis 1 with nothing inside.Positionputs it off-screen, for example scale values above 1 or a large negative offset.
4. Something sets Enabled back to false
Another script, or another handler on the same RemoteEvent, may hide the GUI straight after you show it, for example a round or menu system that closes every GUI on a state change. The Still enabled check in the snippet below catches this: if it prints false, search your scripts for Enabled = false and Visible = false.
5. A server Script is editing StarterGui
StarterGui is only a template. Changing it from a server Script does not affect GUIs players already have, and the server should not be driving a player's screen anyway. Use a LocalScript that edits Players.LocalPlayer.PlayerGui. If the server decides when to show the GUI, fire a RemoteEvent to the client and enable it there.
Debug snippet
-- LocalScript in StarterPlayerScripts (or StarterGui)
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local showGuiEvent = ReplicatedStorage:WaitForChild("ShowGuiEvent") -- your RemoteEvent
showGuiEvent.OnClientEvent:Connect(function()
-- look the GUI up now, not once at the top of the script
local screenGui = playerGui:FindFirstChild("MyScreenGui")
print("Found:", screenGui and screenGui:GetFullName())
if screenGui then
screenGui.Enabled = true
task.wait(1)
print("Still enabled:", screenGui.Enabled)
end
end)If Found prints nil, the name or location is wrong (or the GUI has not been copied in yet). If it prints a path but Still enabled is false, something else is turning it off (cause 4). If both look right and you still see nothing, check the Frame's Visible, Size and Position (cause 3).
Related errors
- roblox infinite yield possible
- roblox is not a valid member of
- roblox attempt to index nil with
- roblox remoteevent fireserver player argument
Related tools: Roblox script generator · Roblox Lua error fixer · all script generators