Check if an actor is dying/dead nearby?
I need some help with this, the point is that the script is supposed to check for an actor nearby that is dead or dying.
heres a part of the code I made:
Code:
for actor in MovableMan.Actors do
local avgx = actor.Pos.X - self.Pos.X;
local avgy = actor.Pos.Y - self.Pos.Y;
local dist = math.sqrt(avgx ^ 2 + avgy ^ 2);
if dist < curdist and actor.Status > 2 then
So it checks for any guy within the range and checks if he's dying.
It seems the "actor.Status > 2" statement is not right, then what is?
Lua console says "trying to compare number with nil".