How to make something pop up on spawn?

This is in Choose\lua\autorun\lua\client\cl_choose.lua
Isnt this supposed to work?


function OnPlayerSpawn( ply )

local window
 
window = vgui.Create( "DFrame" )
window:SetTitle( "Choose A Faction!" ) 
window:SetSize( 300, 300 ) 
window:Center()
window:SetVisible( true ) 
window:ShowCloseButton( true ) 
window:SetDraggable( true ) 
window:MakePopup()
end

DermaImageButton = vgui.Create( "DImageButton", window )
DermaImageButton:SetPos( 50, 52 )								
DermaImageButton:SetSize( 200, 50 ) 
DermaImageButton:SetImage( "materials/us_icon.png" )		 
DermaImageButton:GetStretchToFit()							 
DermaImageButton.DoClick = function()
	RunConsoleCommand ( "say", "/usrecruit" )
end

DermaImageButton = vgui.Create( "DImageButton", window )
DermaImageButton:SetPos( 50, 113 )								
DermaImageButton:SetSize( 200, 50 )							
DermaImageButton:SetImage( "materials/ru_icon.png" )		 
DermaImageButton:GetStretchToFit()							
DermaImageButton.DoClick = function()
	RunConsoleCommand ( "say", "/rurecruit" )
end

DermaImageButton = vgui.Create( "DImageButton", window )
DermaImageButton:SetPos( 50, 173 )								
DermaImageButton:SetSize( 200, 50 )							
DermaImageButton:SetImage( "materials/uk_icon.png" )		 
DermaImageButton:GetStretchToFit()							
DermaImageButton.DoClick = function()
	RunConsoleCommand ( "say", "/ukrecruit" )
end

DermaImageButton = vgui.Create( "DImageButton", window )
DermaImageButton:SetPos( 50, 230 )								
DermaImageButton:SetSize( 200, 50 )							
DermaImageButton:SetImage( "materials/tali_icon.png" )		
DermaImageButton:GetStretchToFit()							 
DermaImageButton.DoClick = function()
	RunConsoleCommand ( "say", "/talirecruit" )
end
	end

PlayerInitialSpawn
Hook_Library_Usage

Ok so this is what I got

Client Side (JobPicker\lua\autorun\client\cl_jobpicker.lua)


net.Receive( "OpenPicker", function()

local window = vgui.Create( "DFrame" )
window:SetTitle( "Choose A Faction!" ) 
window:SetSize( 300, 300 ) 
window:Center()
window:SetVisible( true ) 
window:ShowCloseButton( false ) 
window:SetDraggable( false ) 
window:MakePopup() 

DermaImageButton = vgui.Create( "DImageButton", window )
DermaImageButton:SetPos( 50, 52 )								
DermaImageButton:SetSize( 200, 50 ) 
DermaImageButton:SetImage( "materials/us_icon.png" )		 
DermaImageButton:GetStretchToFit()							 
DermaImageButton.DoClick = function()
	RunConsoleCommand ( "say", "/USRecruit" )
end

DermaImageButton = vgui.Create( "DImageButton", window )
DermaImageButton:SetPos( 50, 113 )								
DermaImageButton:SetSize( 200, 50 )							
DermaImageButton:SetImage( "materials/ru_icon.png" )		 
DermaImageButton:GetStretchToFit()							
DermaImageButton.DoClick = function()
	RunConsoleCommand ( "say", "/rurecruit" )
end

DermaImageButton = vgui.Create( "DImageButton", window )
DermaImageButton:SetPos( 50, 173 )								
DermaImageButton:SetSize( 200, 50 )							
DermaImageButton:SetImage( "materials/uk_icon.png" )		 
DermaImageButton:GetStretchToFit()							
DermaImageButton.DoClick = function()
	RunConsoleCommand ( "say", "/ukrecruit" )
end

DermaImageButton = vgui.Create( "DImageButton", window )
DermaImageButton:SetPos( 50, 233 )								
DermaImageButton:SetSize( 200, 50 )							
DermaImageButton:SetImage( "materials/tali_icon.png" )		 
DermaImageButton:GetStretchToFit()							
DermaImageButton.DoClick = function()
	RunConsoleCommand ( "say", "/talibanrecruit" )
end
	end )

Server Side (JobPicker\lua\autorun\server\sv_netmsg.lua)


util.AddNetworkString( "OpenPicker" )

net.Start( "OpenPicker" )
net.Send( ply )

No errors just not poping up

Is ply actually a reference to a player in your net.Send?

Would ply already be referenced? Or do you have to do
local ply = LocalPlayer ?

At the moment, I’m guessing your ply variable in nil. It’s not representing a player, so you will have to assign it to a player.
When do you want the menu to be opened? When a player enters a chat command?

no, you’ll have to add a hook for when a player spawns

I want it to open when the player joins the server, like the MOTD.

Example here: https://github.com/SubjectAlpha/WorkshopDLPanel

Thank you SO much this helped me so much!