askvity

How to Turn Off the Player List in Roblox (for Developers)

Published in Roblox Development Scripting 3 mins read

Turning off the player list in a Roblox experience is typically something a developer does using scripting, rather than a player adjusting game settings. The player list is a standard part of the core Roblox UI, but developers can choose to hide it.

Disabling the Player List Programmatically

To disable the default player list UI element within your Roblox game, you can use the SetCoreGuiEnabled function on the StarterGui service.

Based on the reference, the specific method to achieve this is by using:

StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)

Explanation:

  • StarterGui: This is a service that manages GUI elements that get copied to a player's PlayerGui when they join.
  • SetCoreGuiEnabled: This is a function used to control the visibility of default Roblox core UI elements.
  • Enum.CoreGuiType.PlayerList: This specifies which core UI element you want to affect – in this case, the Player List.
  • false: This is a boolean value indicating that you want to disable or hide the specified core GUI element. Setting it to true would enable it.

How to Implement the Code

You need to place this line of code within a LocalScript. LocalScripts run on the player's client and are necessary for modifying client-side UI elements like the player list.

Here's how you might implement it:

  1. In the Roblox Studio Explorer, find the StarterGui service.
  2. Right-click on StarterGui and select "Insert Object" -> "LocalScript".
  3. Name the script appropriately (e.g., DisablePlayerList).
  4. Paste the following code into the script:
-- Wait for the StarterGui service to be available (good practice)
local StarterGui = game:GetService("StarterGui")

-- Disable the Player List
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)

Alternatively, you could place this LocalScript within StarterPlayer -> StarterPlayerScripts. Scripts in this location also run on the player's client when they join and are suitable for setup tasks.

Why Disable the Player List?

Developers might choose to disable the default player list for several reasons:

  • Custom UI: They may have created their own in-game player list or scoreboard with a unique design or different information.
  • Game Style: Some game types might benefit from a less cluttered screen or don't require players to constantly see the full list of participants.
  • Specific Mechanics: The game's design might rely on not displaying player names or counts in the standard way.

By using StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false), you effectively hide the default leaderboard element for all players in your experience.

Related Articles