Advertisement
Guest User

Untitled

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