How could I disable the CoreGUI when a gui is on the players screen, and re-enable it when it isn't on the player's screen

I’m wondering how I could disable the CoreGUI when a gui is on a players screen, like in some other games.

That’s the GUI which when on the player’s screen, I would like the CoreGUI to be disabled, and when it is off the players screen, I would like it to be re-enabled.

You can’t because the CoreGui is… well the Core of all Guis so you need it. All you can do is disable other Guis.

1 Like

make a local script and find the gui on the player and do

GameInProgress.Enabled = false

I don’t know how to explain more than that… sorry.

You can take a look at this function of StarterGui.

Example to turn off:

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

Example to turn on:

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)

would this effect other players? In my example I want to disable while talking to an NPC, but only for that player

Just make it local instead of global for it to only affect the player

1 Like