local hp_set = {} --time until enemy swaps from attack to alert (while player can't be seen) local back_to_alert = 6000 --time until enemy swaps from alert to patrol/idle (while player can't be seen) local back_to_patrol = 3000 package.path = "scriptbank/?.lua;" require('ai_zombiewalk3') --name of AI script to use (no .lua needed) function soldier_script_init(e) ai_zombiewalk3_init(e) --init(e) call from the AI script used end function soldier_script_main(e) if hp_set[e] == nil then hp_set[e] = 1 SetEntityHealth(e,g_Entity[e]['health']+5000) else if frozen == 0 then ai_zombiewalk3_main(e) --main(e) call from the AI script used if g_Entity[e]['health'] < 5000 then SetEntityHealth(e,0) end else if g_Entity[e]['health'] < 5000 then if GetPlayerDistance(e) > 80 then CollisionOff(e) else CollisionOn(e) end SetEntityHealth(e,4999) end end --frozen end --hp set --Prompt(ai_soldier_state[e].." "..AIGetEntityHeardSound(g_Entity[e]['obj']).." "..g_Entity[e]['plrvisible'].." "..GetAnimationFrame(e)) end function soldier_script_exit(e) ai_zombiewalk3_exit(e) --exit(e) call from the AI script used end