Each frame, add the distance traveled to some counter, when the counter goes over a specified amount, explode.
Code:
function Create(self)
self.distancecounter = 0;
self.explodedistance = 1000;
self.lastpos = self.Pos;
self.tempvector = Vector(0,0);
end
function Update(self)
self.tempvector = self.lastpos - self.Pos
self.distancecounter = self.distancecounter + self.tempvector.Magnitude
if self.distancecounter > self.explodedistance then
insert explosion lua here or go with
self:GibThis();
end
self.lastpos = self.Pos;
end
Might work, untested though.