VGUI Confusion..

Is there a way to check if a panel is open? I’ve checked and I couldn’t find anything…

if !TeamMenu.Open then – If the menu is closed, then
TeamMenu:MoveTo(ScrW() / 2 - 250, ScrH() / 2 - 200, 1.6, 0,1) – When you open it, it will slide trough the screen, not teleport.
end – Ending the ‘IF’

From my tutorial on GMod wiki.

I would not listen to this guy.

Unfortunately it doesn’t seem like there’s a Panel.GetVisible function, so you can’t tell if the panel is hidden. However, you can check if a panel exists just by comparing it to nil (the value it’ll be if it’s been removed).

[lua]if panel then
print(“my panel exists!”);


Because you’re an idiot

Or you could use a panel:IsValid(), because the panel doesn’t have to be nil to be null, if it was null it would pass the “if panel” check.