I'm making a healing syringe.
The code I'm using heals the actor in the create function, and it checks for the nearest actor. However, I want to create one to heal another guy, so I want to make the particle check if the actor has the object "syringe".
How would the code be? Something like:
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:NotHasObject("Syringe") then -- That's the part of the code I don't know
curdist = dist;
self.target = actor;
end