TTT Sound playing

I’m trying to make a script for my TTT server so that it plays a song every time the round ends and starts. This is my code, it doesn’t play the songs at all.


if SERVER then
	AddCSLuaFile( "game_sounds.lua" )
	resource.AddFile( "sound/rounds/startup.wav" )
	resource.AddFile( "sound/rounds/end.mp3" )
	
	util.PrecacheSound( "sound/rounds/startup.wav" )
	util.PrecacheSound( "sound/rounds/end.mp3" )
end

hook.Add("OnRoundStart", "Begin", function()
	for k,v in pairs(player.GetAll()) do -- Plays to everyone in server not just to your self  
		v:EmitSound("sound/rounds/startup.wav") -- Make sure the Sound is in sound/yoursound.mp3 or .wav  
    end  
end)

function GM:RoundEnd()
	for k,v in pairs(player.GetAll()) do -- Plays to everyone in server not just to your self  
		v:EmitSound("sound/rounds/end.mp3") -- Make sure the Sound is in sound/yoursound.mp3 or .wav  
    end
end

I put this in lua/autorun/server which I think is right

Don’t emit the sound from every player >:|

Put this in “lua/autorun/game_sounds.lua”:

[lua]
if SERVER then
AddCSLuaFile(“game_sounds.lua”)
resource.AddFile( “sound/rounds/startup.wav” )
resource.AddFile( “sound/rounds/end.mp3” )

hook.Add("OnRoundStart", "Begin", function()
	umsg.Start("frettaSound")
		umsg.Char(1)
	umsg.End()
end)

hook.Add("OnRoundEnd", "End", function()
	umsg.Start("frettaSound")
		umsg.Char(2)
	umsg.End()
end)

else
local sounds = {}
sounds[1] = Sound(“sound/rounds/startup.wav”)
sounds[2] = Sound(“sound/rounds/end.mp3”)

usermessage.Hook("frettaSound", function(um)
	local soundID = um:ReadChar()
	surface.PlaySound(sounds[soundID])
end)

end
[/lua]

Everybody copies chiefeh’s servers now D:<

Not that I know who/what your talking about, but I bet that server wasn’t the first.

Wanna bet?

Like I said, I don’t have a clue. But it’s up to the person(s) how they modify their gamemodes.

I don’t even know who chiefeh is lol
I just thought it would add a little more atmosphere to the gameplay.

Oh. :stuck_out_tongue:

Well Chiefeh’s Server is generally the most populated TTT server (well it was, before school started, now it sucks).

So why have I never heard of it - and yet I play on TTT rather a lot? I’m sure I account for many people. Anyhow…