Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Create(self)
- self.FlashTimer = Timer();
- self.HealthTimer = Timer();
- for i = 1,MovableMan:GetMOIDCount()-1 do
- self.gun = MovableMan:GetMOFromID(i);
- if self.gun.PresetName == "Invulnerability Syringe" then
- self.actor = MovableMan:GetMOFromID(self.gun.RootID);
- if MovableMan:IsActor(self.actor) then
- self.parent = ToActor(self.actor);
- self.parentgun = ToHDFirearm(self.gun);
- self.helt = self.parent.Health;
- self.parentgun.ToDelete = true;
- local sound = CreateAEmitter("Syringe Sound","BR.rte");
- sound.Pos = self.Pos;
- MovableMan:AddParticle(sound);
- sound:GibThis();
- self.actor = ToActor(self.parent);
- self.acID = self.actor.ID;
- break
- end
- end
- end
- end
- function Update(self)
- if self.actor then
- self.actor.Health = self.helt;
- if self.FlashTimer:IsPastSimMS(150) then
- self.actor:FlashWhite(75);
- self.FlashTimer:Reset();
- end
- if self.HealthTimer:IsPastSimMS(1000) then
- self.helt = self.helt - 1;
- self.HealthTimer:Reset();
- end
- if self.actor.Health < 1 or self.actor.ID ~= self.acID then
- self.ToDelete = true;
- end
- end
- end
- --Ximximik.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement