Ad
Log in to vote
0

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

Asked by 18 days 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 — 18d
0
Don't help LYESPILLEDINMYEYES -14 — 18d
0
huh? Loverainbow07 0 — 18d

2 answers

Log in to vote
0
Answered by 18 days 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 17 days 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