Help with sounds

I’m having problems adding sounds to Garry’s Mod.

I’m trying to use this to play sounds in a serverside way

but I can’t figure out how to get it to play custom sounds.

The main problem is finding out where to put the sound files in gmod so that they can be accessed through console like that.

Would anyone happen to know how to add custom sounds to Garry’s Mod in this way?

So i looked over the code and you can add your own sounds in it.
Just put a sound anywhere in garrysmod/sounds/music/ and you can also put it in a custom folder like MyUberSoundz so it would be garrysmod/sounds/music/MyUberSoundz and then in the PlaySound addon you open up PlayMusicSelect.lua and find


local function PlayMusicMenu( Panel )

and under it should be all the buttons, so you just add a custom one like this:



		local params = {}
		params.Text = "Half-Life 1 - ''Black Mesa Inbound''"
		params.Description = "[Atmosphere]"
		params.Command = "playsound music/HL1_song3.mp3"
		Panel:AddControl( "Button",params)

You need to replace Half-Life 1 - ‘‘Black Mesa Inbound’’ WITH your own name of the button, you can change [Atmosphere] , its the description, now change music/HL1_song3.mp3 with your own sound you added in garrysmod like music/mycoolsong.mp3 .

So i’ll just give you an example of a custom one:


		local params = {}
		params.Text = "My Cool Song Name"
		params.Description = "[Action]"
		params.Command = "playsound music/MyCoolSongHere.mp3"
		Panel:AddControl( "Button",params)

And it should work.

If you’re using ULX admin mod, you can just type “ulx playsound <sounddir>”. (E.g: ulx playsound epicfolder/theepicsound.wav)

If no one is downloading it you need to forcedl it so,

This will make all clients download the specific “theepicsound.wav” sound.

You can try test it with Wires Sound Emitter first, if that works then everything else should work.

EDIT:

My bad, i didn’t notice your first paragraph. What he said ^

Put the sounds in the /garrysmod/garrysmod/sound/ folder. In the PlaySound addon, you gotta start as if you were in the /sound/ directory.

Actualy, the PlaySound addon uses /garrysmod/garrysmod/sound/music/ Directory instead of /garrysmod/garrysmod/sound/

custom sounds need to be passed to your clients for your clients to hear them.

I meant it starts off at /sound/

In the addon, it has “music/HL1_song3.mp3” so it’s starting with /sound/ then music/