I know that there's a way to code in win music depending on the team who won is, or was. But, Say I had 5 traitor win songs, and 5 innocent win songs, What would I do to make them randomly pick from those depending on who won?
An example of what I have so far is as follows :
resource.AddFile("sound/ttt/traitorwin1.mp3")
resource.AddFile("sound/ttt/innocentwin1.mp3")
local function PlayMusic(wintype)
if wintype == WIN_INNOCENT then
BroadcastLua('surface.PlaySound("ttt/innocentwin1.mp3")')
elseif wintype == WIN_TRAITOR then
BroadcastLua('surface.PlaySound("ttt/traitorwin1.mp3") ')
elseif wintype == WIN_TIMELIMIT then
BroadcastLua('surface.PlaySound("ttt/innocentwin1.mp3")')
end
end
hook.Add("TTTEndRound", "MyMusic", PlayMusic)
I know that designates only one song per team, but What would I have to do to make it select from one of the 5 traitor songs when a traitor wins, or from the 5 other songs when innocents win, thanks!