Hello, I am making a Shop GUI on and I have a exit button (which works) but, I would like to also make a button that toggles the screen GUI on and off
I have had multiple attempts at this but here is what I have so far in my localscript.
local frame = script.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function()
if frame.Enabled then frame.Enabled = true
end)
So all the "Parents" link up to the GUI that I am wanting to toggle, but the rest I just don't understand why it does not work.
Here is the exit button script in case if anyone needs it.
script.Parent.MouseButton1Click:connect(function()
script.Parent.Parent.Enabled = false
end)
If anyone knows how to help me could they tell me what I did wrong so I could see my mistakes and I am willing to accept their question if it helps me out in any way.
Thank you for reading this!

1 comment
Well, there is no property in a SurfaceGUI called "Visible" but there is enabled which basically does the same thing which I used instead of Visible