Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Hiding Health, Backpack and Player List?

I need tons of help on hiding my Health, Backpack and Player List on my game. Please I need tons of help!

5 answers

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

3 comments

0

So if I wanna do 1 at a time I have to do

0

game.StarterGui:SetCoreGuiEnabled("PlayerList", true) | game.StarterGui:SetCoreGuiEnabled("Health", true) | game.StarterGui:SetCoreGuiEnabled("Backpack", true) ALL in one scritpt?

0

Well, you want to turn them off. So just replace your trues with falses and yeah, you're all good!

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:

http://wiki.roblox.com/index.php?title=CoreGuiType

This discussion is preserved as it was. New answers, comments, and votes are closed.