function GameMode:OnNPCSpawned(keys)
DebugPrint("[BAREBONES] NPC Spawned")
DebugPrintTable(keys)
local npc = EntIndexToHScript(keys.entindex)
local datadriven_runordie = npc:FindAbilityByName("datadriven_runordie")
if npc:IsRealHero() then
if datadriven_runordie then
datadriven_runordie:SetLevel(1)
end
end
local npc = EntIndexToHScript(keys.entindex)
end
это через слушателя или просто функция в аддон гейм модКод:function GameMode:OnNPCSpawned(keys) DebugPrint("[BAREBONES] NPC Spawned") DebugPrintTable(keys) local npc = EntIndexToHScript(keys.entindex) local datadriven_runordie = npc:FindAbilityByName("datadriven_runordie") if npc:IsRealHero() then if datadriven_runordie then datadriven_runordie:SetLevel(1) end end local npc = EntIndexToHScript(keys.entindex) end
Это функция слушателя npc_spawnedэто через слушателя или просто функция в аддон гейм мод