Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. function Create(self)
  2.     self.FlashTimer = Timer();
  3.     self.HealthTimer = Timer();
  4.     for i = 1,MovableMan:GetMOIDCount()-1 do
  5.         self.gun = MovableMan:GetMOFromID(i);
  6.         if self.gun.PresetName == "Invulnerability Syringe" then
  7.             self.actor = MovableMan:GetMOFromID(self.gun.RootID);
  8.             if MovableMan:IsActor(self.actor) then
  9.                 self.parent = ToActor(self.actor);
  10.                 self.parentgun = ToHDFirearm(self.gun);
  11.                 self.helt = self.parent.Health;
  12.                 self.parentgun.ToDelete = true;
  13.                 local sound = CreateAEmitter("Syringe Sound","BR.rte");
  14.                 sound.Pos = self.Pos;
  15.                 MovableMan:AddParticle(sound);
  16.                 sound:GibThis();
  17.                 self.actor = ToActor(self.parent);
  18.                 self.acID = self.actor.ID;
  19.                 break
  20.             end
  21.         end
  22.     end
  23. end
  24. function Update(self)
  25.     if self.actor then
  26.         self.actor.Health = self.helt;
  27.         if self.FlashTimer:IsPastSimMS(150) then
  28.             self.actor:FlashWhite(75);
  29.             self.FlashTimer:Reset();
  30.         end
  31.         if self.HealthTimer:IsPastSimMS(1000) then
  32.             self.helt = self.helt - 1;
  33.             self.HealthTimer:Reset();
  34.         end
  35.         if self.actor.Health < 1 or self.actor.ID ~= self.acID then
  36.             self.ToDelete = true;
  37.         end
  38.     end
  39. end
  40. --Ximximik.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement