I was wondering how you would close a vgui when you press a button? I made a button, and I want it when it’s pressed, it sets the player to that team, and closes the vgui too. Here is the code, add it in there if you would:
[lua]
local team2 = vgui.Create( “DButton”, tc2 )
team2:SetSize( 100, 75 )
team2:CenterHorizontal()
team2:SetText( “Sharp Shooters” )
team2.DoClick = function()
RunConsoleCommand( “sn_team2” )
end
end
[/lua]