Was following Lee along in Broadcast#49 "Spawning Millions of AI" and although I made the necessary modifications to my ai script to reposition the enemies, I can't for the life of me figure out how to identify entities in the for loop like he does.
GetEntityLUAHealth(e) gives me this error:
While the new g_Entity[e]['health'] gives me this one:
If anyone could help me with this I would be very grateful.
My current script (attached to barrel):
egdg_spawncycle = 0
egdg_plrclose = 0
function egdg_spawn_init(e)
egdg_spawncycle = 0
egdg_plrclose = 0
end
function egdg_spawn_main(e)
Prompt(" spawncycle = "..egdg_spawncycle.." plrclose = "..egdg_plrclose)
if g_Time > egdg_spawncycle and egdg_plrclose == 0 then
egdg_spawncycle = g_Time + 5000
for e = 1,21,1 do
if GetEntityLUAHealth(e) ~= 999999 and GetEntityLUAHealth(e) ~= 10000 then
if GetEntityLUAHealth(e) <= 0 then
Spawn(e)
end
end
end
end
if GetPlayerDistance(e) >= 250 then
egdg_plrclose = 0
elseif GetPlayerDistance(e) <= 249 then
egdg_plrclose = 1
end
end
The author of this post has marked a post as an answer.
Go to answer