function Create(self) -- A lovely variable to keep track of how many shots the gun had left when we started firing self.initialBoolets = self.Magazine.RoundCount; -- Variables for easy tweaking of parameters self.fastBurst = 3; self.highROF = 900; self.lowROF = 600; end function Update(self) -- Is there even a magazine in the gun? if self.Magazine ~= nil then -- Check if we're firing the gun. if self:IsActivated() then -- The initialBoolets variable is constant while we're firing, so... local roundsFired = self.initialBoolets - self.Magazine.RoundCount; -- If we have fired less shots than the limit for the fast rate of fire... if roundsFired <= self.fastBurst then -- Set the rate of fire to the most dakkariffic. self.RateOfFire = self.highROF; -- If we have fired MORE shots than the limit... else -- Slow down horsey! self.RateOfFire = self.lowROF; end -- If we're NOT firing the gun, and initialBoolets is not equal to the current round count... elseif self.initialBoolets ~= self.Magazine.RoundCount then -- Make it so! self.initialBoolets = self.Magazine.RoundCount; end end end