In short
SetCoreGuiEnabled turns Roblox's built-in screen parts on or off, such as the backpack, the player list or the health bar. They are drawn on each player's own device, so only a LocalScript can change them. Move the call into a LocalScript in StarterPlayerScripts. To hide them for everyone, that one LocalScript runs for every player.
What the message means
ServerScriptService.HideUI:3: StarterGui:SetCoreGuiEnabled must be called from a local script.
The server has no screen, so a server Script cannot change what a player sees. That is why the call is refused there.
The setting also resets when a player rejoins, so the LocalScript runs again each time, which is what you want.
Causes and fixes
Two things cause this error in practice. Each one below has the smallest code that triggers it, then the fix.
The call is in a server Script
A Script in ServerScriptService or Workspace runs on the server.
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
Put the same line in a LocalScript in StarterPlayerScripts.
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
The server decides when to hide it
Hiding the UI during a cutscene or round is decided on the server, so the call ends up in server code.
local StarterGui = game:GetService("StarterGui")
local function startCutscene()
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
end
startCutscene()
Send a RemoteEvent to the clients, and let a LocalScript hide or show the UI when it arrives.
local StarterGui = game:GetService("StarterGui")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local setUiHidden = ReplicatedStorage:WaitForChild("SetUiHidden") :: RemoteEvent
setUiHidden.OnClientEvent:Connect(function(hidden: boolean)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, not hidden)
end)
-- on the server: setUiHidden:FireAllClients(true)
Fix it in your place
Paste the error, RoCode fixes it in your place
Copy the line from Output and paste it here. RoCode opens the script it names in the place you have open in Studio, works out which of the causes above it is, and edits the code there instead of handing you a snippet to paste.
RoCode is an AI agent for Roblox Studio: it reads the scripts in the place you have open, finds the line and edits it there, and every change is an undo point. It runs on Windows or macOS with a desktop browser. Free to start, with free credits every day.
How to find the line that causes it
- Open Output (Window menu, or the Script tab), clear it with Ctrl+K (⌘K on Mac), and press Play.
- Find the first red line. It starts with the script's place in the Explorer and the line number, such as
ServerScriptService.Shop:12:. - Click the red line. Studio opens that script with the cursor on the failing line.
- Read the lines between
Stack BeginandStack Endunder it: they list the calls that led there, newest first, so you can see which function called the broken one. - Still not sure which value is wrong? Add
print(typeof(x), x)just above the line, or set a breakpoint on it and read the values in the Watch window.
Questions
How do I hide the backpack in Roblox?
In a LocalScript: game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false).
Can I hide the chat this way?
Enum.CoreGuiType.Chat is one of the types. Chat also has its own settings in TextChatService, such as the chat window's Enabled property.
Why does SetCore fail but SetCoreGuiEnabled work?
SetCore can fail early while the core scripts are still loading. See SetCore has not been registered.
Can RoCode fix it?
Yes. Paste the Output line into RoCode. It moves the call into a LocalScript in your open place, with a RemoteEvent when the server decides.
Sources and further reading
How the code was checked: every block marked Fixed passes Luau's strict type checker against Roblox's API definitions (luau-lsp, 12 November 2026), and every block marked Breaks compiles and fails only when it runs. The message wording was checked against the strings in Roblox Studio itself (macOS build installed on 12 November 2026) on 12 November 2026. A type check catches misspelt APIs and wrong types, not game logic, so playtest in Studio before you publish.