Disabling the Game Interface

Disabling the Game Interface

2 min

Roblox comes with a set of GUI elements that are by default enabled for all games. These include:

  • the list of players
  • the current player’s health bar
  • the player’s backpack
  • chat window

If you do not need one of these elements or you have written your own, the StarterGui service has the functionality to enable and disable each of them.

How To Turn On/Off GUI Elements

StarterGui has a function called StarterGui/SetCoreGuiEnabled|SetCoreGuiEnabled which is used to turn on and off elements of the basic GUI that Roblox provides. The first thing the function needs is a CoreGuiType. This is the element you want to set. The second thing the function needs is a boolean (true/false value) which represents whether you want that element on or off. The list of elements you can enable or disable are:

  • Enum.CoreGuiType.PlayerList
  • Enum.CoreGuiType.Health
  • Enum.CoreGuiType.Backpack
  • Enum.CoreGuiType.Chat
  • Enum.CoreGuiType.All

SetCoreGuiEnabled can only be called in a local script. This means that any changes to the GUI you make will only apply to the player who owns that local script.


This example just turns off the Health bar:

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)

This example turns off all of the Core GUIs:

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

This example turns off all of the Core GUIs except for Chat:

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)

Topbar GUI

The topbar contains default Roblox GUI, and can be disabled. This causes all other Roblox GUI to be disabled. Using StarterGui/SetCore (not StarterGui/SetCoreGuiEnabled|SetCoreGuiEnabled!), you can disable it like this:

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCore("TopbarEnabled", false)

Note that the hamburger menu button at the top left cannot be disabled.

Touch GUI

When a Roblox game is played on a device with touch capabilities, two more elements are added to the players GUI: a control pad and a jump button. Those can be hidden by using the UserInputService like this:

local UIS = game:GetService("UserInputService")
UIS.ModalEnabled = true

Xbox One GUI

The Xbox One version of Roblox has a few differences than other platforms.

  • Chat - The chat GUI does not appear and any calls to SetCoreGuiEnabled(Enum.CoreGuiType.Chat) are ignored
  • Playerlist - The playerlist is always enabled and any calls to SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) are ignored
  • Topbar - The topbar does not appear
  • gui
  • game
  • chat
  • coding