Make your own SpawnMenu?

Hi, im making a gamemode where you can only use certain ents in the spawnmenu so im uing the GM:GetSENTMenu() function. But this is not working. Any help.

Lua



include("shared.lua")
DeriveGamemode("sandbox")

function GM:SpawnMenuOpen()
	return false
end

function GM:ContextMenuOpen()
	return true
end

pressed = false

function GM:GetSENTMenu() 
 
 	local columns = {} 
 	columns[ 1 ] = "#Name" 
 	columns[ 2 ] = "#Author" 
 	columns[ 3 ] = "#Admin" 
 
 	local ret = {} 
 
 	table.insert( ret, columns ) 
 
 	local entlist = {
					stargate_atlantis
					jumper
					stargate_sg1
					dhd_sg1
					dhd_atlantis
					}
 
 	for k,v in pairs( entlist ) do 
 
 		if ( v.t.Spawnable || v.t.AdminSpawnable ) then 
 
 			local entry = {} 
 			entry[ 1 ] 	= v.t.PrintName 
 			entry[ 2 ] 	= v.t.Author 
 			if ( v.t.AdminSpawnable && !v.t.Spawnable ) then entry[ 3 ]  = "ADMIN ONLY" else entry[ 3 ]  = "" end 
 			entry[ "command" ]  = "gm_spawnsent "..v.t.Classname 
 
 			table.insert( ret, entry )		 
 
 		end 
 
 	end 
 
 	return ret 
 
 end 

 hook.Add( "SpawnMenu", "SENTMenu", GetSentMenu )
 
function SpawnMenu()

if( input.IsKeyDown( KEY_Q ) ) then
	
	if( not pressed ) then
		
		pressed = true;
		
		hook.Call( SENTMenu, SG-Build )
		
	end
end
end

hook.Add( "Think", "PressedQ", SpawnMenu )


thanks

It would be easier if you just created your own derma menu to spawn entities from…

and then use a console command to tell the shared.lua to create said entity with the set model. Really easy to understand :stuck_out_tongue: