Gmod 9 Lua Help

Discussion in 'Garry's Mod 9' started by Fort Man, Sep 5, 2010.

  1. Fort Man New Member

    Joined:
    May 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Ok so I have everything down with lua scripting except 1 thing, sound. How do I make it so that my new swep has a new sound without overlapping the default sound.
    EX.
    I make a swep that is originally an awp skin, how do I give it a sound without removing regular awp sound.
     
  2. nafrayu Super Moderator Staff Member

    Joined:
    Jan 29, 2008
    Messages:
    395
    Likes Received:
    8
    Trophy Points:
    18
  3. Fort Man New Member

    Joined:
    May 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Yes I actually get this, but how do I make it so that i plays a custom sound?


    ----------------------------------------------------------------------------
    --_SWEPSetSound(MyIndex, "single_shot", "Weapon_AWP.Single") --play an awp sound everytime we shoot

    _EntEmitSound(MyIndex, "Weapon_AWP.Single") --Make the weapon emit an AWP sound
     
  4. nafrayu Super Moderator Staff Member

    Joined:
    Jan 29, 2008
    Messages:
    395
    Likes Received:
    8
    Trophy Points:
    18
    Copy any .wav file to "gmod9/sound/" and point the 2nd argument of _EntEmitSound to that file, e.g.
    _EntEmitSound(MyIndex, "fortman/railgun.wav")

    [​IMG]