Song to play when a client joins the server

Is there anything that already does this?
If not could someone help me make one?

hook.Add(“PlayerInitialSpawn”, “86865866986878”, function( ply )
ply:EmitSound("<sound path here>")

Why emit sound? I am pretty sure we don’t need people around us. Have the client do:

local sound = “music/file.mp3”;

ply:ConCommand("play "…sound);

Or if you want, make a usermessage and have it do surface.PlaySound

So if I the client to play a sound file called “gamefire” I would put:
local sound = “sound/gamefire.mp3”;
ply:ConCommand(“play sound/GameFire.mp3”);

Remove the sounds/ part.

From every part of the code?

local sound = “gamefire.mp3”;
ply:ConCommand(“play gamefire.mp3”);

Addfile starts at garrysmod folder…
“play” command at sound folder

ply:ConCommand("play gamefire.mp3")

autorun\client right? If so it doesn’t want to work.

It’s serverside.

Still not working

Lua does not simply read your mind.

local soundFile = “gamefire.mp3”
resource.AddFile( “sound/” … soundFile )

local function joinSound( pl ) – Our function to be called, pl is the player object.
pl:ConCommand( "play " … soundFile )
hook.Add( “PlayerInitialSpawn”, “sound_spawn”, joinSound ) – Hook the function so it gets called everytime a player spawns for the first time.