Disable clicking on GUI if it is not at front of screen

Hello everyone, I have a shop GUI, that can be activated. However, when the the shop GUI is open, the player can still click where the play button was, and it would teleport them to the game. How could I stop this from happening, without disabling the play GUi?

Add a frame with ZIndex higher than the frame you dont want to be clicked but lower than the shop frame.

If you read the original post carefully, OP stated that they didn’t want to disable the button Gui.
Also, I don’t think Clicked is a function of a GuiButton.

You could use

if not gui.Visible then

to achieve the same result

oops, my bad, i didn’t see the if not gui.Visible then part, and I didn’t really have much context. i’ll get rid of the post

I forgot to mention, the play GUI is in a different screenGUI than the shop. Is there a property that can change this? (I remember there was some property for that but I couldn’t find it)