Hide GUI when Roblox in-game menu is open

How can I make my GUI frame recognise when the player has the in-game roblox menu open?
When the menu is on screen I want my frame to hide but then when the roblox menu is closed I want my frame to show again.

Are you referring to the escape menu? If so, you can use these events GuiService.MenuClosed and GuiService.MenuOpened to detect when it is opened/closed and hide/show the gui accordingly

May be obvious but keep in mind these events are client only, like UserInputService