Guest User

Untitled

a guest
Jan 24th, 2013
30
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     local p1 = self.object:getpos();
  2.     for _,ent in ipairs(ents) do
  3.         local p2 = ent:getpos();
  4.         local lenx = math.abs(p2.x - p1.x);
  5.         local leny = math.abs(p2.y - p1.y);
  6.         local lenz = math.abs(p2.z - p1.z);
  7.         local hypot = math.sqrt((lenx * lenx) + (lenz * lenz));
  8.         local dist = math.sqrt((hypot * hypot) + (leny * leny));
  9.         local damage = (explosion_damage * dist / explosion_range);
  10.         ent:set_hp(ent:get_hp() - damage);
  11.     end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×