function leftClick(mouse) script.Parent.Parent.Box.Visible = true end script.Parent.MouseButton1Click:connect(leftClick) function leftClick(mouse) script.Parent.Parent.Box.Visible = false end script.Parent.MouseButton1Click:connect(leftClick)
Thats the script I have and it will only open, not close
If you want to go the shorter route, try setting the visibility to the opposite of what it is now. You didn't exactly specify if you wanted to do anything other than open or close the menu, but if you wanted some event to be fired in between, definitely go with one of the other answers.
node.MouseButton1Click:Connect(function() button.Visible = not button.Visible end)
local gui = --locate gui local textbutton = --locate textbutton textbutton.MouseButton1Click:Connect(function() if gui.Enabled == true then gui.Enabled = false else gui.Enabled = true end
Just try that, local script inside StarterGui.
Try this:
local frame = script.Parent.Parent.Frame script.Parent.MouseButton1Click:connect(function() if frame.Visible == false then frame.Visible = true else frame.Visible = false end end)?