• Music end round. Help!
    2 replies, posted
[CODE]-- You can add up to 3 sounds for this. Add or delete resource.addfile as you need resource.AddFile("sound/YG.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("YG'..math.random(1,3)..'.mp3")') elseif wintype == WIN_TRAITOR then BroadcastLua('surface.PlaySound("YG'..math.random(1,3)..'.mp3")') elseif wintype == WIN_TIMELIMIT then BroadcastLua('surface.PlaySound("YG.mp3")') end end hook.Add("TTTEndRound", "MyMusic", PlayMusic)[/CODE] It does not work
Here's mine; I give this out to help people learn from it. Change the files, that's it that's all. [url]https://dl.dropboxusercontent.com/u/26074909/acecool_ttt_end_round.rar[/url] If you want to learn something; code it so that the array of sounds is shared, and send only the win type, and the index of the song chosen instead of the string of the song.
Sorry, you need to Log In to post a reply to this thread.