Music playing when a player finished joining game

First of all, hello everybody :=)

I was wondering if that was possible that a music launches when the player finished joining, like CSS by exemple.
Isn’t this possible with some lua coding? I’m not lua coder, so that is why I post it here, because if that is possible for Gmod, did someone allrealy made it? Or can someone can make a script? Thanks in advance.

Also sorry if my english is bad, I’m french ^^’


It’s quite easy, add this to a client-side file. That could mean the cl_init.lua of your gamemode or lua/autorun/client.

local function SpawnMusic()
surface.PlaySound( “path/to/your/sound.wav” )
hook.Add( “InitPostEntity”, “SpawnMusic”, SpawnMusic)

To have the clients download the music if they don’t have it use this serverside :


D’accord thanks man, I’ll test it out.