Join Server & Play Sound

Hi guys!
I need something to my server.
I want a script that makes this:

  • When a player join the server, he hear a custom sound.
    Only this.
    Thanks so much!

I know how to make this:

  • When player join the server, show to him a message.
    This is that script:

-- Code to show a message to a player, when he joins the server
function Spawn ( ply )
	ply:PrintMessage (HUD_PRINTTALK, "Welcome " .. ply:Nick () .. ", enjoy with us!")
end
hook.Add( "PlayerSpawn", "spawnmessage", Spawn )

You’ll have to network it clientside and use this function: http://wiki.garrysmod.com/page/surface/PlaySound

No need to network it,

GM/InitPostEntity clientside should do.

Too early; player will still be on the loading screen and will not hear it

http://wiki.garrysmod.com/page/Category:timer

Or just put it in PlayerInitalSpawn and avoid the hacky guess times.

PlayerInitalSpawn is called before the player entity is created and would cause the same issue

Not if the player hasn’t selected a team/spawned; depends totally on the gamemode.

The gamemode it’s for Trouble in Terrorist Town. When the people see the Motd (for example). I’m not a coder, can you make a script? Thanks for reply!