DeathRun End round Music.

Hello all, I have been trying to find out how to get this to work with my really low Lua skills and I have this:

-- You can add up to 3 sounds for this. Add or delete resource.addfile as you need

-- Remember to change the name of the sounds to the sound you want from above
local function PlayMusic(wintype)
   if wintype == WIN_RUNNER then

   elseif wintype == WIN_DEATH then

   elseif wintype == WIN_TIMELIMIT then
hook.Add("DeathRunEndRound", "MyMusic", PlayMusic)

I know its a script that takes up to 1min or less to make, so I won’t say ill pay :
But I was wondering if someone could help or tell me whats I’m doing wrong.

All help is welcome.

That hook already exists?

I remember using it for my old deathrun server … however it was in gmod12.
If it won’t be called … the hook doesn’t exist. If it use Fretta … try change the hook to: “OnRoundResult

Its just the new DeathRun gamemode. I tookThat script from the ttt end round music, so It was not made for DR. Any more ideas on how to get it to work?

Wait, dose any one know the Hook’s that are in DeathRun?

View the readme.txt inside the deathrun gamemode to view the hooks.

hook.Add( “OnRoundSet”, “Round Set Example”, function( round, winner )
if round == ROUND_ENDING then
if winner == TEAM_RUNNER then
elseif winner == TEAM_DEATH then
elseif winner == 123 then – If the winner is the timelimit, it will be the number 123.
end )[/lua]

You’re the one with the gamemode, look em up.

Thank you so much, and I love the new set up of the NEW DeathRun mode. Its much more easier to work with. lol


One more thing :3
May I ask were I put this script.

I put in the server like this: /lua/autorun/server/endround.lua.
Is that wrong because its not working.

Yes, it should be inside lua/autorun/server/, and I just copied part of what you gave, remove the “sound/” part of the file paths. surface.PlaySound already reads from the /sound/ folder, so it’s trying to play sound/sound/runnerswin.mp3 and etc.

Okay that worked, Now one more thing then you can stop looking at this thread if you want. How would I make it so the end round lasts a little longer so they can hear the full end round sound?
I have looked in “sv_round.lua” But I don’t really know what to edit.

If you could find that out or someone else does and you see it please post it here! Im trying to add this also and its hard making ending sounds less than 10 seconds

I guess I could add a setting for that in the next update. Change line 115 in sv_round.lua to whatever number you want for now.

Thank you.

This don’t work :S

^Not working…

Sorry for the LONG ASS BUMP, but this won’t work for me. The sound folder goes in garrysmod/sound right?

Never mind, I forgot to add the files to my FastDL.