function EFFECT:Init( data ) self.start = CurTime() self.ent1 = data:GetEntity() if ValidEntity(self.ent1) then self.emitter = ParticleEmitter( self.ent1:GetPos(), false ) self.ent2 = ents.GetByIndex(data:GetScale()) end end function EFFECT:Think() if ValidEntity(self.ent1) and ValidEntity(self.ent2) then local p = self.emitter:Add( "effects/muzzleflash"..math.random( 1, 4 ), self.ent1:GetPos() + (self.ent1:GetForward() * 15) ) p:SetDieTime(math.Rand(0.05,0.1)) p:SetGravity( Vector(0,0,0) ) p:SetVelocity(self.ent1:GetVelocity()) p:SetAirResistance(0) p:SetStartSize(math.Rand(5,10)) p:SetEndSize(math.Rand(2,4)) p:SetRoll(math.Rand(-5,5)) p:SetColor(255,255,255,255) p:SetEndAlpha( 0 ) local p = self.emitter:Add( "effects/muzzleflash"..math.random( 1, 4 ), self.ent2:GetPos() + (self.ent1:GetForward() * 15) ) p:SetDieTime(math.Rand(0.05,0.1)) p:SetGravity( Vector(0,0,0) ) p:SetVelocity(self.ent2:GetVelocity()) p:SetAirResistance(0) p:SetStartSize(math.Rand(5,10)) p:SetEndSize(math.Rand(2,4)) p:SetRoll(math.Rand(-5,5)) p:SetColor(255,255,255,255) p:SetEndAlpha( 0 ) end return false end function EFFECT:Render() end