Gui menu button

I am trying to make a menu button that makes existing buttons in other guis become visible/invisible.

GUIs:
Black = What I’m trying to make visible
Yellow = What I’m making it visible from.


ignore the circled team change

Current script:

local menu = script.Parent:WaitForChild("Menu")
local admin = script.Parent.Parent:WaitForChild("AdminGui")

menu.MouseButton1Click:Connect(function()
	if admin.MenuButton.Visible == true then
		admin.MenuButton.Visible = false
	elseif admin.MenuButton.Visible == false then
		admin.MenuButton.Visible = true
	end
end)

I’m not seeing why this doesn’t work. There are no related errors in output. Help is appreciated.

EDIT: My whole script wasn’t showing, sorry. It is now.

There’s first no need to do that, is there output error?
put the script inside the button this:

local menu = script.Parent:WaitForChild("Menu")
local Player = game.Players.LocalPlayer
local admin = Player:WaitForChild('AdminGui')

menu.MouseButton1Click:Connect(function()
	admin.MenuButton.Visible = not admin.MenuButton.Visible
end)
1 Like

This does not work either. There are no output errors for either script.

That doesn’t work because all GUIs from StarterGui go into PlayerGui and not just the Player. you should try the same code but change local admin = Player:WaitForChild('AdminGui') to local admin = Player.PlayerGui:WaitForChild('AdminGui').

still not working, still nothing in output

What are you trying to make?
Visible AdminGui > MenuButton
Visible TeamChange > MenuButton
But TeamChange not working im true?

No, ignore the teamchange gui for now, that is the same line of code as the admin gui. the admin gui visible doent work. Thats why i said

local menu = script.Parent:WaitForChild("Menu")
local admin = script.Parent.Parent:WaitForChild("AdminGui")

menu.MouseButton1Click:Connect(function()
if admin.Enabled == true then
	admin.Enabled = false
elseif admin.Enabled == false then
	admin.Enabled = true
end
end)

actually, i missed this error in output:

Try doing

local menu = script.Parent.Parent:WaitForChild("Menu"):WaitForChild("Menu")

local admin = script.Parent.Parent:WaitForChild("AdminGui")

menu.MouseButton1Click:Connect(function()
       admin.MenuButton.Visible = not admin.MenuButton.Visible
end)

Can you try this? maybe it will work. (Thats working on my place.)

local menu = script.Parent:WaitForChild("Menu")
local admin = script.Parent.Parent:WaitForChild("AdminGui")

menu.MouseButton1Click:Connect(function()
if admin.Enabled == true then
	admin.Enabled = false
elseif admin.Enabled == false then
	admin.Enabled = true
end
end)
2 Likes

No sense on doing this…
bruh

So why it was marked as “solution”

Well, clearly you didn’t do anything, and just connected a bit of the parents
If you actually even tried to help him you could basically do
admin.Enabled = not admin.Enabled

Yeah i didnt do so much things because thats not a big problam.So thats a solution of this issue.

His solution did work. I understand programming so once i got the local variables down it doesnt matter which solution i did. I am here for help with existing code im not an idiot noob.