Help!: Adding music to end of round. (TTT)

I have this lua code in ‘./garrysmod/lua/autorun/’ folder for my server:

-- You can add up to 3 sounds for this. Add or delete resource.addfile as you need

-- Remember to change the name of the sounds to the sound you want from above
function PlayMusic(wintype)
hook.Add("TTTEndRound", "MyMusic", PlayMusic)

Every time I join my server it downloads cakeisgone.mp3 and then I can’t find it anywhere in MY garrysmod files.
Why won’t it download properly and reuse it?

Then I go into to my server and after the round ends, no music it played and in the console it says it can’t find the cakeisgone.mp3.

I think the problem is that it cannot download the file? Any ideas would help! Thanks.

You using fastdl?

No, is that required? I know their has to be a certain size of file that it uses?

No it’s not required at all, however it can cause problems with people downloading the files. So don’t worry about that.

I did a look up of FastDL:
So what I did was I didn’t realize that I had a site already set up with my host and was already set up in the server.cfg file. Added cakeisgone.mp3 to a folder called sound on the site and now it downloads the song and doesn’t ask for it again :smiley:

But it still doesn’t play the song and say the same error again above in picture 2.

On the clientside lua (cl_init), try using
since it will be playing there.

If the above post doesn’t work, try adding sound/ to your file directory.
Like so:


As that’s what I use and it works :stuck_out_tongue:

Wouldn’t putting sound there adversely effect the path, since PlaySound defaults in the sound folder?

I was not sure where to place

so I placed it at the top of the file and did not change anything, Not sure what that does either, tbh.

I was thinking the same thing but I tried it anyways, it didn’t work either. :confused:

That’ll try to play garrysmod/sound/sound/cakeisgone.mp3

Any other ideas to fix this?

I’m not sure if related but do I want Pure Server disabled or enabled?

Does the file exist in garrysmod/downloads/sound/ or garrysmod/sound/ after you’ve entered the server?

In garrysmod/sound/ it does.

Does it give you the same error if you type “play cakeisgone.mp3” in console?

It does give the same error.

I’d recommend getting FastDL first off, just because it makes it x2 as easier.


Then put this
local function PlayMusic(wintype)
– Play sounds when a team wins
if wintype != WIN_TRAITOR then

hook.Add(“TTTEndRound”, “MyMusic”, PlayMusic)

I might be totally misreading the problem here though…

I have all that setup.
Good News:
Not sure what changed but it started working ><
Everyone on the server could hear the music

But thanks everyone for the help! :smiley: