• Help With TTT Round Preparing Music
    2 replies, posted
Hi, I've been working on a simple script to play music during the preparing phase of a TTT round. I'm rather new to Gmod coding so forgive me for my errors. This is the script I have so far (located in lua/autorun/server) [CODE]--TTT Pre-Round Music resource.AddFile("sound/ode.mp3") hook.Run ("TTTPrepareRound") if TTTPrepareRound then BroadcastLua('surface.PlaySound("ode.mp3")') else print ("The Round Proper Has Begun") end [/CODE] The script doesn't work, but it also doesn't seem to be putting errors out in console. If anyone could give me some pointers as to how I can fix this I would appreciate it.
I just tried writing an alternate form of the script, but it isn't working either. Any ideas? [CODE] --TTT Pre-Round Music resource.AddFile("sound/ode.mp3") hook.Add("TTTPrepareRound", "Prep", Prepmusic) local Prepmusic = function() if TTTPrepareRound then BroadcastLua('surface.PlaySound("ode.mp3")') else print ("The Round Proper Has Begun") end Prepmusic() end [/CODE]
[CODE] if SERVER then resource.AddFile "sound/ode.mp3" else hook.Add( "TTTPrepareRound", "PrepSound", function() surface.PlaySound "ode.mp3" end ) end [/CODE]
Sorry, you need to Log In to post a reply to this thread.