Play music on server entry.

Greetings.
Just wondering if someone would be able to send me in the right direction scriptwise, if i wanted to play music on a client after it has joined.


function PlayMusic(pl)
	pl:SendLua("surface.PlaySound(\"soundpath.wav\")")
end
hook.Add("PlayerInitialSpawn","PlayMusic",PlayMusic)

Like that?

Here, try this.


function GM:PlayerConnect(name,address,steamid)
surface.PlaySound( "/directory/from/within/sound/folder/to/sound/file.mp3" )
LocalPlayer():ChatPrint("Hello "..name..", welcome to SERVERNAMEHERE!)
end

[editline]11:50PM[/editline]

FUCK. Ninja’d. I’d recommend his.

Yep, thanks.