@AmenMoses: A few years ago you wrote this fantastic script for me that caused a timed reduction in AI health when near an entity. I have been trying to get it to work in GG Max but I have been unsuccessful so far. I am guessing that GG Max handles AI health differently but I can' t figure out how. I have also been studying your NPC_in_range script which seems similar to what I am trying to accomplish. What do I need to add or change to get this great script to work in Max? Thanks
-- DESCRIPTION: Timed removal of AI health near an entity
local U = require "scriptbank\\utillib"
function ai_hurtzone_init( e )
Include( "utillib.lua" )
end
local timer = 0
local hurtValue = 10
local hurtDist = 2000
function ai_hurtzone_main( e )
if g_Time > timer then
timer = g_Time + 5000
local Ent = g_Entity[ e ]
for _, v in pairs( U.ClosestEntities( hurtDist, math.huge, Ent.x, Ent.z ) ) do
if ai_bot_state[ v ] ~= nil then
if g_Entity[ v ].health > 0 then
SetEntityHealth( v, g_Entity[ v ].health - hurtValue )
end
end
end
end
end
(I tried to put this in code snippet but clearly I did something wrong)