TTT SLOW MOTION AND RANDOM MUSIC HELP

Well, heres the code i have and i filled it out with the songs i have and it works. The thing is when the traitor or inno kills someone i would like the round to have slo mo? I’ve seen it on a lot of other servers. And lets say i have a lot of musics and i would like them to play randomly if that was possible? Thanks :stuck_out_tongue:


resource.AddFile("sound/ttt/traitor_win.mp3")
resource.AddFile("sound/ttt/innocent_win.mp3")

local function PlayMusic(wintype)
   if wintype == WIN_INNOCENT then
      BroadcastLua('surface.PlaySound("ttt/innocent_win.mp3")')

   elseif wintype == WIN_TRAITOR then
      BroadcastLua('surface.PlaySound("ttt/traitor_win.mp3")')

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

Did you google at all? I came up with this on the first result.

http://steamcommunity.com/sharedfiles/filedetails/?id=107658972 – One I got from Workshop

Thanks, but not as a ttt wep or something. I just want it to automatically do it without having to use points or anything. And for it to work if you’re a innocent or traitor

… It isn’t a weapon…

Yea i made it work now. but, is it possible to make the songs i have play randomly when round ends? thanks :stuck_out_tongue:

Create a table, and have it select randomly from the table.

Thanks