TTT EndRoundMusic Problem

I have my end round music, has been working forever, i then changed the names of the songs in the file (Changed the song) and it just didn’t play ingame, I have restarted and put it on fastdl ,you do download it on join.

Before edits:
[lua]-- You can add up to 3 sounds for this. Add or delete resource.addfile as you need
resource.AddFile(“sound/i wish.mp3”)
resource.AddFile(“sound/the alibi.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(“the alibi.mp3”)’)

elseif wintype == WIN_TRAITOR then
BroadcastLua(‘surface.PlaySound(“i wish.mp3”)’)

elseif wintype == WIN_TIMELIMIT then
BroadcastLua(‘surface.PlaySound(“the alibi.mp3”)’)
end
end
hook.Add(“TTTEndRound”, “MyMusic”, PlayMusic)
[/lua]

After:
[lua]
– You can add up to 3 sounds for this. Add or delete resource.addfile as you need
resource.AddFile(“sound/inno win.mp3”)
resource.AddFile(“sound/traitors win.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(“inno win.mp3”)’)

elseif wintype == WIN_TRAITOR then
BroadcastLua(‘surface.PlaySound(“traitors win.mp3”)’)

elseif wintype == WIN_TIMELIMIT then
BroadcastLua(‘surface.PlaySound(“inno win.mp3”)’)
end
end
hook.Add(“TTTEndRound”, “MyMusic”, PlayMusic)
[/lua]

My FTP (Shows i have it installed.)

Any help at all?

Does console output anything? Your music could have incorrect samplerate.

Console outputs nothing.

[lua]
// Initialize the tables
local im, tm, km = {}, {}, {}

 // Inno music

for u,i in pairs(file.Find(“sound/tttend/inno/*”,“MOD”)) do
resource.AddFile(i)
table.insert(im, i)
end
print("im: " … #im)

 //Traitor music

for r,t in pairs(file.Find(“sound/tttend/trait/*”,“MOD”)) do
resource.AddFile(t)
table.insert(tm, t)
end
print("tm: " … #tm)

//Time out

for j,k in pairs(file.Find(“sound/tttend/time/*”,“MOD”)) do
resource.AddFile(k)
table.insert(km, k)
end
print("km: " … #km)

 //Plays music depending on wintype, and it's randomized

local function wDMX(wintype)
if wintype == WIN_INNOCENT then
BroadcastLua(‘surface.PlaySound("’ … table.Random(im) … ‘")’)
elseif wintype == WIN_TRAITOR then
BroadcastLua(‘surface.PlaySound("’ … table.Random™ … ‘")’)
elseif wintype == WIN_TIMELIMIT then
BroadcastLua(‘surface.PlaySound("’ … table.Random(km) … ‘")’)
end
end

hook.Add(“TTTEndRound”, “wDMx”, wDMX)

[/lua]

Use this instead, Drop your files into sound/ttend/(inno/trait/time)

Thanks, will test it soon and get back!

Here’s the one I give out, it doesn’t use BroadcastLua, it uses Net messages:

https://dl.dropboxusercontent.com/u/26074909/ttt_end_round.rar

Tried it… didnt work.

It works, but the new sounds dont play… only the old.

you have lua somewhere that wont go away

that works on my server and i literally took it right off

your server is fucked

Nah, i fixed it, isnt the lua problem, was the song file, the samplerate.