Help with hiding ScreenGuis while Main Menu is in frame

  1. What do you want to achieve?
    I want to hide all of the ScreenGuis in the game until the play button is pressed on the main menu screen.

  2. What is the issue?
    I am not sure how to go about hiding the ScreenGuis. The code either doesn’t work or breaks the main menu screen. (Red X or dot = hide)

  1. What solutions have you tried so far?
    The Hide UI tutorials on YouTube were somewhat helpful, but the issue I ran into was when a player resets, the GUIs turn invisible again. And since the main menu only shows up upon first joining the game, there is no way to toggle the GUIs back on. The existing script hides all of the CoreGui elements effectively, but the challenge I am facing is how to also hide the ScreenGuis.

Current LocalScript (Startup):

image

local startergui = game:GetService("StarterGui")

startergui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
startergui.MainMenu_Right.Enabled = false
startergui.Settings.Enabled = false
startergui.Left_Side.CharList.Enabled = false
startergui.Left_Side.CharacterChanger.Enabled = false
startergui.Left_Side.RoleplayNameGui.Enabled = false
startergui.Left_Side.ShopMenu.Enabled = false

script.Parent.Enabled = true
3 Likes

Hey there!

You can do 2 things to slove this:

1: Disable the option in the GUIs’ properties where it resets it whenever the Character respawns. This will make the GUI always stay at the same state, even when you open up something (for example Settings) and reset, it will stay on-screen.

2: Keep the GUIs’ reset option enabled, so everytime a player resets they turn back on (if they are by default always Enabled) and the only time you would have to turn them off is when the Player is in the Menu (once joining the game) and if the Player decides to go back to the Menu again.

I’m not exactly sure if this will help you out, as I believe I’ve read something wrong in your post (:upside_down_face:) , but be sure to reply with any further things you’d like to point out in case this didn’t help.

2 Likes

You need to access UIs through the player (players.LocalPlayer.PlayerGui)

Disabling the ResetOnSpawn property worked, thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.