• Where do i put this ?
    1 replies, posted
[QUOTE]local ShootSound1 = Sound("weapons/alyx_gun/alyx_gun_fire3.wav") local ShootSound2 = Sound("weapons/alyx_gun/alyx_gun_fire4.wav") local ShootSound3 = Sound("weapons/alyx_gun/alyx_gun_fire5.wav") local ShootSound4 = Sound("weapons/alyx_gun/alyx_gun_fire6.wav") self:EmitSound( "weapons/alyx_gun/alyx_gun_fire"..math.random(3, 6)..".wav" )[/QUOTE] i made an thread asking how to make multiple fire sounds to an swep , lolcats helped me and i got this code but i dont know where to put it ... any help ?
You don't need ShootSound 1-4 because the math.random covers the sounds; because EmitSound uses a .wav string instead of a sound object. You could simplify the code by putting this in a shared file: [code]local WeaponSounds = { "weapons/alyx_gun/alyx_gun_fire3.wav"; "weapons/alyx_gun/alyx_gun_fire4.wav"; "weapons/alyx_gun/alyx_gun_fire5.wav"; "weapons/alyx_gun/alyx_gun_fire6.wav"; }; function SWEP:EmitShootSound( ) self:EmitSound( table.Random( WeaponSounds ) ); end[/code] and calling self:EmitShootSound( ); inside of your PrimaryAttack.
Sorry, you need to Log In to post a reply to this thread.