Open on Spawn

waht the code for having a menu open on player initial spawn?

this is what your init.lua should look like

[lua]
function GM:PlayerInitialSpawn( ply ) //“When the player first joins the server and spawns”

 ply:ConCommand( "team_menu" ) //Run the console command when the player first spawns 

end //End that shit! [/lua]

still needs a console command created to open a menu

[lua]
function set_team()

frame = vgui.Create( “DFrame” )
frame:SetSize( 300, 300 ) //Set the size
frame:SetTitle( “Change Team” ) //Set title
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )
frame:MakePopup()
frame:CenterHorizontal()
frame:CenterVertical()
end
concommand.Add( “team_menu”, set_team )[/lua]

also works with usermessages

im still a luanewb hope this helps

Just a note: The above would go in cl_init.lua

And it depends if you wanted for the player to access it at any time (using console commands), or just have it popup when they spawn (using usermessages).