The FaceWAN forums have been archived. Join our Discord server at facewan.com/chat.
← Garry's Mod 9

Gmod 9 Lua Help

Started by Fort Man · Sep 05, 2010 · 3 replies · 2392 views
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.
Take this simple swep as a base, i also commented alot of it's functions: https://pastebin.ca/1933969 ;)

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
Originally posted by Fort Man, post: 46158:
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


Copy any .wav file to "gmod9/sound/" and point the 2nd argument of _EntEmitSound to that file, e.g.
_EntEmitSound(MyIndex, "fortman/railgun.wav")


← Previous Thread
Where to download Gmod 9
Next Thread →
Post your Builds!