So here is my code I used: script.Parent.MouseButton1Click:connect(function()
script.Parent.Parent.Frame.Visible = not script.Parent.Parent.Frame.Visible
end)
StarterGUI>ScreenGUI>Frame and I put the open and close gui in that screenGUI too. I put that code in the local script of the frame that I named OpenAndClose.
2 Things.
If i run your code (without click function) it works fine. Have you checked the "Output" window for any errors? (>Top >View >Output)
Shown that your code would work: https://gyazo.com/9c93099996d25a909b5d733dfa70eab1
Ok first of all, Frames don't have MouseButton functions. Second of all, your code would run fine if it had a Text Button instead of the frame. Set the Text Button to have no text. If you really want a frame, just put the Text Button ontop of it with a higher Z-Index
I'm not your spoonfeeder.
All you have to do is to have your gui, and then a TextButton. Use MouseButton1Click or any mouse events that makes sense in your situation, and the best way would be to check if the gui is open, do a simple if statement on the gui property «Visible»
No need for elseif when dealing with boolean stuff
--Assuming you set Shop to your frame if Shop.Visible == true then --Open else --close end
I'm writing from my phone, I'm sorry if I made any mistakes...