Re: Weapon Gibs based on remaining ammo/mag status?
Arcalane wrote:
either spawning a set number of particles/etc. for each round remaining,
Code:
function Create(self)
if self.Magazine then
self.ammoCounter = self.Magazine.RoundCount;
else
self.ammoCounter = 0;
end
end
function Update(self)
if self.Magazine ~= nil then
self.ammoCounter = self.Magazine.RoundCount;
else
self.ammoCounter = 0;
end
end
function Destroy(self)
for i = 1, self.ammoCounter do
self.gib = CreateTDExplosive("Frag Grenade");
self.gib.Pos = self.Pos;
MovableMan:AddParticle(self.gib);
end
end
Arcalane wrote:
or based on steps (if more than x spawn a projectiles, if more than y spawn b projectiles, etc. etc.).
Code:
function Create(self)
if self.Magazine then
self.ammoCounter = self.Magazine.RoundCount;
else
self.ammoCounter = 0;
end
end
function Update(self)
if self.Magazine ~= nil then
self.ammoCounter = self.Magazine.RoundCount;
else
self.ammoCounter = 0;
end
end
function Destroy(self)
if self.ammoCounter > 3 and self.ammoCounter < 5 then
self.gib = CreateTDExplosive("Frag Grenade");
self.gib.Pos = self.Pos;
MovableMan:AddParticle(self.gib);
end
if self.ammoCounter >= 5 and self.ammoCounter < 10 then
self.gib = CreateTDExplosive("Pineapple Grenade");
self.gib.Pos = self.Pos;
MovableMan:AddParticle(self.gib);
end
end