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)
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').
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)
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)
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
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.