• "garrysmod" Directory "sound" folder wont work
    7 replies, posted
Hello I have recently have made a weapon prototype and have tried to add a sound when the weapon fires, to my knowledge there is only one way to do this that I have seen, by creating a folder named "sound" in \Steam\steamapps\common\GarrysMod\garrysmod then adding a file in that directory. Sadly I can not seem to do anything to get it to make a sound im adding the sound in SWEP.Primary.Sound = Sound("/sound/pistolsound.mp3")  please help, im very new to Lua to please be easy on me, thanks
inside your first sound folder, do you have a second sound folder or is the pistolsound.mp3 instantly the first thing after the first sound folder?
first thing
Try removing the leading slash. Are you also actually referencing self.Primary.Sound in code?
what do you mean by leading slash and yes in the Lua file for the weapon
He is talking about the first slash. So it would be "sound/" instead of "/sound/"
oops typo no I do not have a first slash I use .mp3 as the sound format should I switch to .wav?
There is no need to convert to wav. If your sound is in garrysmod/garrysmod/sound/sound/pistolsound.mp3, then your code is correct. (This one) SWEP.Primary.Sound = Sound("sound/pistolsound.mp3") But if your sound is in garrysmod/garrysmod/sound/pistolsound.mp3, your code is incorrect and should be: SWEP.Primary.Sound = Sound("pistolsound.mp3") Models are the only thing in this game that require you put the first folder name in the directory. For some reason materials and sounds do not follow this convention and has been the bane of many issues when people have asked me for help regarding sounds. If your sound doesn't play after the changes to the code, then it is because your sound is not 44100hz.
Sorry, you need to Log In to post a reply to this thread.