From b0169e7ca20fd9fa4ae889af8fff16d2bf638a18 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 21 Oct 2016 22:41:39 -0400 Subject: fixed NPC spawning --- gamemode/npcsystem/loadnpcs.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gamemode/npcsystem/loadnpcs.lua') diff --git a/gamemode/npcsystem/loadnpcs.lua b/gamemode/npcsystem/loadnpcs.lua index 9bf839b..85b3cd6 100644 --- a/gamemode/npcsystem/loadnpcs.lua +++ b/gamemode/npcsystem/loadnpcs.lua @@ -2,30 +2,34 @@ local Folder = GM.Folder:gsub("gamemodes/","").."/gamemode/npcsystem/npcs" local insert = table.insert function GM:LoadNPCS() - print("NPC's loaded") + print("NPC's loaded!!!") local Items = file.Find(Folder.."/*.lua","LUA") local BaseItem = {} GAMEMODE.Npcs = {} NPC = {} - + print("Printing something else!") AddCSLuaFile(Folder.."/base.lua") include(Folder.."/base.lua") BaseItem = table.Copy(NPC) + print("Items table was",Items) for k,v in pairs(Items) do + print("Found an npc's file") if (v != "base.lua") then AddCSLuaFile(Folder.."/"..v) include(Folder.."/"..v) insert(GAMEMODE.Npcs,NPC) + print("Inserting ",NPC.Name) NPC = table.Copy(BaseItem) end end + print("Finished loading npc's") end hook.Add("Initialize","Loadnpcs",function() -- cgit v1.2.3-70-g09d2