How do I turn my ScreenGUI on and off?
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.
1 | local frame = script.Parent.Parent.Parent |
2 | script.Parent.MouseButton 1 Click:connect( function () |
3 | if frame.Enabled then frame.Enabled = true |
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.
1 | script.Parent.MouseButton 1 Click:connect( function () |
2 | script.Parent.Parent.Enabled = false |
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!