An event for detecting when the main menu is opened -- does it exist?

I have a couple GUI’s that I’d like to hide whenever the Main Menu (yes, the Core GUI menu) is opened. Is there an event for this? I scoured the DevHub for answers, nothing. I also checked out :SetCore() and :GetCore() but there was nothing that matched my case.

If what I am asking is unclear, please let me know.

4 Likes
local Player = game.Players.LocalPlayer
local GuiService = game:GetService("GuiService")

GuiService.MenuOpened:Connect(function()
	print(Player.Name.." opened their menu.")
end)

GuiService.MenuClosed:Connect(function()
	print(Player.Name.." closed their menu.")
end)
19 Likes

You could try using UserInputService and hiding the UI when they escape key is pressed.

1 Like

Ik old thread but escape key can still be used as a keybind although it’d be kinda dumb, it is still possible. Best to just work with the MenuOpened event.

1 Like

I tried this and it sends 2 msgs, so prob try using local debounce = false on this one if you know