✓ Accepted answer
this is easy to do as not only you can use it for this, but you can use it for click detectors and so on.
i am assuming you are using a text button to do this, or anything relevant to that.
you would instead put the local script into the button that is parented to the screen GUI.
(at least, this is how i do it and have done it)
but anyways, in order for the script to detect a RIGHT CLICK, you would use 'MouseButton2Click', like below:
script.Parent.MouseButton2Click:Connect(function()
if script.Parent.Frame.Visible == false then
script.Parent.Frame.Visible = true
else
script.Parent.Frame.Visible = false
end
end)
hopes this helps!!
1 comment
script.Parent.Frame.Visible = not script.Parent.Frame.Visible