• TTT Music
    4 replies, posted
[CODE]local soundTable = {Inno={"weliketoparty.mp3", "cantbefriends.mp3", "pirate.mp3", "pushittothelimit.mp3"}, Trait={"minnesotaburns.mp3", "imblue.mp3", "raininmen.mp3", "mortalkombat.mp3"}, Time={"pokemon.mp3", "kicks.mp3", "betteroffalone.mp3", "scatman.mp3"}} local function PlayMusic(wintype) if wintype == WIN_INNOCENT then BroadcastLua('surface.PlaySound("'..table.Random(soundTable[Inno])..'")') elseif wintype == WIN_TRAITOR then BroadcastLua('surface.PlaySound("'..table.Random(soundTable[Trait])..'")') elseif wintype == WIN_TIMELIMIT then BroadcastLua('surface.PlaySound("'..table.Random(soundTable[Time])..'")') end end hook.Add("TTTEndRound", "MyMusic", PlayMusic)[/CODE] I'm trying to find a working script because I've tried many that I've made, and none of them work. This one above was given from 'Cushie' but it still doesn't work. I stuck this in lua/autorun/server. And, I put in the resource.AddFile for all the .mp3 files.
[CODE]resource.addfile as you need resource.AddFile("sound/innocent_gang.mp3") resource.AddFile("sound/traitor_win.mp3") resource.AddFile("sound/innocent_nowin.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("innocent_gang.mp3")') elseif wintype == WIN_TRAITOR then BroadcastLua('surface.PlaySound("traitor_win.mp3")') elseif wintype == WIN_TIMELIMIT then BroadcastLua('surface.PlaySound("innocent_nowin.mp3")') end end hook.Add("TTTEndRound", "MyMusic", PlayMusic)[/CODE] Not my work just something I use.
Same as mine, but I'm not sure why mine does not work.
put it in .lua file and put it in lua/autorun Also your not adding the resource files to be downloaded to clients.
It's in a .lua file and I already put in the resource.AddFile code. Nobody responds on Facepunch :P
Sorry, you need to Log In to post a reply to this thread.