Hello everyone,
I recently made a TTT server a while back, and I'd like to add music at the end of rounds. I read through some posts on this website, and managed to get one working. Here it is:
resource.AddFile("sound/ttt/traitor_win.mp3")
resource.AddFile("sound/ttt/inno_win.mp3")
resource.AddFile("sound/ttt/time_win.mp3")
local function PlayMusic(wintype)
if wintype == WIN_INNOCENT then
BroadcastLua('surface.PlaySound("ttt/inno_win.mp3")')
elseif wintype == WIN_TRAITOR then
BroadcastLua('surface.PlaySound("ttt/traitor_win.mp3") ')
elseif wintype == WIN_TIMELIMIT then
BroadcastLua('surface.PlaySound("ttt/time_win.mp3")')
end
end
hook.Add("TTTEndRound", "MyMusic", PlayMusic)
That one works wonderfully, but I get tired of hearing the same "Traitors Win" and "Innocents Win" all the time. Does anyone know how to make this so it plays a sound from random, no matter who wins? Thanks a bunch C: