Does anyone know why this script doesn’t work? It’s supposed to hide some parts of a gui but it’s not working for me. It’s in a local script inside a textbutton.
It would help if you showed the way your GUI is set up in the workspace.
Also if you put some print statements in there for troubleshooting to see what sections of the script actually run that may help.
i think you are using starter gui instead of playergui. research on playergui.
you supposed to do game.Players.LocalPlayer.PlayerGui.frame.AllCues.Visible = false
i think maybe
local Player = game:GetService("Players").LocalPlayer
adminGui = Player:WaitForChild("PlayerGui"):WaitForChild("adminGui")
script.Parent.MouseButton1Click:Connect(function()
for i,obj in pairs(adminGui:GetChildren()) do
obj.Visible = false
end
end)
Is there a specific reason you are using two ScreenGuis for the admin. It is usually easier to put the entire admin Gui inside of one screen Gui. That way you wouldnt be required to find another screengui in player gui
The first line is already assuming: “I’ve already defined my adminGui, so we’re all set here!”
Yeaaaaaaah no. It will error, resulting in: adminGui is not a valid member of PlayerGui as the Gui has not entirely loaded in yet
But if we go ahead and change our hidden Gui to this: