summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/autorun/zone_huntingground.lua27
1 files changed, 19 insertions, 8 deletions
diff --git a/lua/autorun/zone_huntingground.lua b/lua/autorun/zone_huntingground.lua
index cc494a1..b16efce 100644
--- a/lua/autorun/zone_huntingground.lua
+++ b/lua/autorun/zone_huntingground.lua
@@ -33,15 +33,19 @@ local monsters = {
"npc_tunneler_queen",
}
]]
-local monsters = scripted_ents.GetList()
-local sub = {}
-for k,v in pairs(monsters) do
- if k:find("npc_") then
- sub[#sub+1] = k
+local monsters
+local function find_monsters()
+ if monsters == nil then
+ monsters = scripted_ents.GetList()
+ local sub = {}
+ for k,v in pairs(monsters) do
+ if k:find("npc_") then
+ sub[#sub+1] = k
+ end
+ end
+ monsters = sub
end
end
-monsters = sub
-
-- Use this hook to let a player change a zone after making it or with the edit tool.
-- class is zone.class, zone is the zone's full table, DPanel is a panel to parent your things to, zoneID is the zone's ID, DFrame is the whole frame.
-- Return your preferred width and height for the panel and the frame will size to it.
@@ -73,7 +77,7 @@ hook.Add("ShowZoneOptions","artery_huntingground",function(zone,class,DPanel,zon
monsterlb:SizeToContents()
local freqlb = vgui.Create("DLabel",headerbar)
freqlb:Dock(RIGHT)
- freqlb:SetText("Spawn frequency (0-100)")
+ freqlb:SetText("Spawn frequency (0-100) : Health")
freqlb:SetDark(true)
freqlb:SizeToContents()
@@ -140,6 +144,12 @@ hook.Add("ShowZoneOptions","artery_huntingground",function(zone,class,DPanel,zon
zone.npctbl[name] = tonumber(frequency:GetValue())
synctbl()
end
+
+ local health = vgui.Create('DTextEntry',thisbar)
+ health:SetText(100)
+ health:SetNumeric(true)
+ health:Dock(RIGHT)
+ health:SizeToContents()
end
print("Before drawing npctbl was")
@@ -152,6 +162,7 @@ hook.Add("ShowZoneOptions","artery_huntingground",function(zone,class,DPanel,zon
newpanelbut:SetText("+")
newpanelbut:Dock(BOTTOM)
newpanelbut.DoClick = function()
+ if not monsters[1] then find_monsters() end
mkrow(monsters[1],0)
end