Hello, i’m trying to make a SWEP that plays a sound when you left click and changes the sound when you right click. So far i have this
function SWEP:PrimaryAttack() sound = 1 if ( sound == 1 ) then self:EmitSound("physics/body/body_medium_break2.wav") end if ( sound == 2 ) then self:EmitSound("physics/cardboard/cardboard_box_break1.wav") end end function SWEP:SecondaryAttack() sound = sound + 1 if sound > 2 then sound = 1 end end
It doesn’t seem to be working, can anybody help? Thanks.