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? :)
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)
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)