I have a GUI with multiple frames in it, and want to make all of them close when I press the menu button.
Here is how my Gui is set up
Gui
Menu Button
Script
Frame 1
Script
Button 1
Button 2
Script
Frame 2
Buttons within Frame 2
The script in the Menu Button
local MenuSelect = script.parent.parent.MenuSelect
local Menubtn = script.parent
script.Parent.MouseButton1Click:Connect(function()
local Buttons = script.Parent.Parent.Buttons
if Buttons.Visible == false then
Buttons.Visible = true
else
Buttons.Visible = false
end
end)
Basically what this does is open Frame 1
Script in button 2
local Emotes = script.Parent
script.Parent.MouseButton1Click:Connect(function()
local EmotesGUI = script.Parent.Parent.Parent.EmotesGUI
if EmotesGUI.Visible == false then
EmotesGUI.Visible = true
else
EmotesGUI.Visible = false
end
end)
This opens frame 2 to the side
I want the Menu button to close ALL frames,
I've tried using something like this
if Button2.Visible == false then Frame2.Visible = false
which basically means since the menu button closes button 2, it should close frame 2 aswell, but I cant get it to work.
Any ideas?

1 comment
Simply change the ScreenGui's "Enabled" property to false and all GUI's in that ScreenGui, including Frames, will close