There’s this really odd problem with my SWEP. Basically, on the server SecondaryAttack() is called only once (as it should), but on the client it gets called multiple times.
Here’s how I’ve defined my SWEP’s secondary attack variables.
--Secondary fire. SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "none"
Here’s my secondary attack function.
--[[ SecondaryAttack() Activates when +attack2 is pressed. --]] function SWEP:SecondaryAttack() if( self.Weapon:GetNextSecondaryFire() > CurTime() ) then return end print( "SWEP:SecondaryAttack()" ) self.Weapon:SetNextSecondaryFire( CurTime() + 0.2 ) end
So, when I press right click ONCE on the client, then the server prints the line only once to the console, yet on the client it’s printed twice, thrice and sometimes even four times in a row. Any ideas?