How to hide chat and leaderboard (+ top icons) when clicked something

Hello!
I’m trying to make the screen more clear when opening GUIs, so how would I disable chat, hide the leaderboard and hide the top icons (not including the menu icon).

What code do I need for that?

Something like this:

Thank you!

5 Likes

this is what youre looking for i believe

1 Like

Try this in a local script:

local sgui = game:GetService("StarterGui")
sgui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
sgui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
sgui:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, false)
11 Likes

Is that for local player (+ in local script), right?

2 Likes

Alternatively, you can do:

sgui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

@Wizertex to answer your question, yes

2 Likes

All the above solutions will work. If you ever want to fully hide the topbar (get rid of it entirely), use the following code.

sgui:SetCore("TopbarEnabled",false)

This will automatically get rid of all core UIs, including player list, chat, backpack, etc, and make the topbar invisible. All it will leave is the player’s username, their age (<13 or 13+), and the menu button.

7 Likes