TTT End Round Music

Hey, I’ve been trying to add End of Round music to my TTT server, but for some reason, it’s saying that I don’t acctually have the server file on there, There are no lua errors, but the sound just isn’t playing. I’ve put the sound in garrysmod/sound/‘personalfolder’ and added it to FastDL, but nothings happening.


-- You can add up to 3 sounds for this. Add or delete resource.addfile as you need
resource.AddFile("wow/american.mp3")
resource.AddFile("wow/pirate.mp3")
resource.AddFile("wow/booty.mp3")

-- Remember to change the name of the sounds to the sound you want from above
local function PlayMusic(wintype)
   if wintype == WIN_INNOCENT then
      BroadcastLua('surface.PlaySound("american.mp3")')

   elseif wintype == WIN_TRAITOR then
      BroadcastLua('surface.PlaySound("pirate.mp3")')

   elseif wintype == WIN_TIMELIMIT then
      BroadcastLua('surface.PlaySound("booty.mp3")')
   end
end
hook.Add("TTTEndRound", "MyMusic", PlayMusic)

Should be
[lua]resource.AddFile(“sound/wow/american.mp3”)[/lua]
not
[lua]resource.AddFile(“wow/american.mp3”)[/lua]

I’ve already tried this, It was originally that, but I chanegd it because I was unaware.

Also, it shouldn’t work at all because:


BroadcastLua('surface.PlaySound("american.mp3")')

Should be “wow/american.mp3”

Since Netheous answered your question, here’s my input: If you every want to change that to a random sound for each different win type, and use net messages instead of Broadcast Lua, or for learning purposes, here’s the one I give out:

Just goes into addons.
https://dl.dropboxusercontent.com/u/26074909/ttt_end_round.rar

Thanks dude, but it’s still not working for some reason, did you want me to post the code?

Go for it. The only thing you really need to edit on mine is adding sounds to the lists at the top.