I need tons of help on hiding my Health, Backpack and Player List on my game. Please I need tons of help!
What you're looking for is the method SetCoreGuiEnabled. It's a member of StarterGui.
To hide the Health bar, backpack, and player list, you're going to need to do this:
game.StarterGui:SetCoreGuiEnabled(4, false) game.StarterGui:SetCoreGuiEnabled(3, true)
What that does is set all the core gui elements activation to 'off', then turns the chat coregui element back 'on' (because you wanted that one)
Let me know if you have any further questions!
You're looking for the SetCoreGuiEnabled
method of StarterGui.
Keep in mind, this has to be in a LocalScript to work, so put this code inside a LocalScript in StarterGui:
Game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false) Game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
In localscript in StarterGui
game:GetService("StarterGui"):SetCoreGuiEnabled("Health", false)
Hiding this only takes one function, SetCoreGuiEnabled. However, keep in mind that you must use it with a LocalScript
.
Now then, here's a quick rundown. The first argument specifies that CoreGui you want to remove. The options are PlayerList
, Health
, Backpack
, Chat
and All
. These are enums, but can expressed as strings (as shown bellow). The second argument determines if the GUI should be shown or hidden. In this case we'd want to hide it.
game.StarterGui:SetCoreGuiEnabled("All", false) -- Setting them all off is quicker than doing it one-by-one game.StarterGui:SetCoreGuiEnabled("Chat", true) -- Now we make chat visible again
Simple, this can be done through a local script with
game:GetService("StarterGui"):SetCoreGuiEnabled("All", On)
This is used to make certain CoreGuis be hidden/Shown,
On is the true/false value, setting it to false will make the CoreGui be hidden.
The numbers/names for CoreGuis can be found here: