Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i make menu button open and close a gui?

Asked by 1 year ago

I am currently trying to make any form of a game in Roblox studios, yet I would like to allow when a button is pressed it will open a specific GUI and then when it is clicked again it will then close the same GUI.

Here is the script that I have so far:


script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Frame.Visible = true end)

Please could someone help? :)

0
No 67peicbm46bv8buws8ig 0 — 1y
0
Don't help LYESPILLEDINMYEYES -14 — 1y
0
huh? Loverainbow07 0 — 1y

2 answers

Log in to vote
0
Answered by 1 year ago

put this in a button as a local script in screengui this will open and close the frame

script.Parent.MouseButton1Click:Connect (function()

    script.Parent.Parent.Frame.Visible = not script.Parent.Parent.Frame.Visible

end)
Ad
Log in to vote
0
Answered by 1 year ago

I have this script that is still working. (Remember that those script are Local Script and must be inserted inside of any button separately)

Open Gui: script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Frame.Visible = true end)

Close Gui: script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Visible = false end)

Answer this question