diff options
Diffstat (limited to 'gamemode/npcsystem/aidirector.lua')
| -rw-r--r-- | gamemode/npcsystem/aidirector.lua | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gamemode/npcsystem/aidirector.lua b/gamemode/npcsystem/aidirector.lua index fb85b2d..008ad1a 100644 --- a/gamemode/npcsystem/aidirector.lua +++ b/gamemode/npcsystem/aidirector.lua @@ -8,7 +8,7 @@ concommand.Add("ws_spawnbird",function(ply,cmd,args) SpawnNpcByName("Bird",ply:GetPos())
end)
-concommand.Add("ws_spawnnpc",function(ply,cmd,args)
+local function spawnnpcfunc(ply,cmd,args)
if(!args[1]) then print("You must enter the name of an npc")
return end
@@ -18,7 +18,9 @@ concommand.Add("ws_spawnnpc",function(ply,cmd,args) print("attempting to spawn npc...")
SpawnNpcByName(args[1],ply:GetPos())
print("NPC spawned!")
-end, function(cmd,stringargs)
+end
+
+local function spawnnpccomplete(cmd,stringargs)
print(cmd, stringargs)
local tbl = {}
stringargs = string.sub(stringargs,2)
@@ -36,7 +38,13 @@ end, function(cmd,stringargs) end
end
return tbl
-end, "Spawns an NPC from winter survival, useage: ws_spawnnpc <name>")
+end
+
+if(SERVER) then
+ concommand.Add("ws_spawnnpc",spawnnpcfunc, spawnnpccomplete, "Spawns an NPC from winter survival, useage: ws_spawnnpc <name>")
+else
+ concommand.Add("ws_spawnnpc",spawnnpcfunc, spawnnpccomplete, "Spawns an NPC from winter survival, useage: ws_spawnnpc <name>")
+end
function SpawnNpcByName(name, position)
if(CLIENT) then return end
@@ -93,6 +101,11 @@ function SpawnNpcByName(name, position) if(entdata.OnSpawn) then
ent.OnSpawn = entdata.OnSpawn
end
+ --[[
+ if(entdata.BehaveCycle) then
+ ent.BehaveCycle = entdata.BehaveCycle
+ end
+ ]]--
print("NPC created")
ent:Spawn()
print("NPC spawned")
|
