I’m trying to create a SENT based NPC which opens a window from the function “OpenWholesaleMenu” however it’s just not working for me. I have little knowledge about LUA but slowy learning. Could anyone help me?
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( 'shared.lua' )
function ENT:SpawnFunction( id, tr )
local trace = util.GetPlayerTrace( id, id:GetAimVector() )
local tr = util.TraceLine( trace )
local NPC = ents.Create("npc_citizen")
NPC:SetPos( tr.HitPos + tr.HitNormal * 30 )
NPC:Spawn()
NPC:Activate()
end
function ENT:Initialize()
end
function ENT:Use( activator, caller )
caller:OpenWholesaleMenu()
end