On join sound play

I just wanted to know how to make it so when an admin joins the server it plays a sound! Any help would be great Thank You.

use hook.Add(“PlayerInitialSpawn”, “UniqueName”, function( ply )
ply:EmitSound(“sound/pathto/sound.wav”, 40(Volume), 500(Pitch))
end)

To be more specific on how to do this:
Create these two files in this folder “garrysmod/lua/autorun”
cl_player.lua
sv_player.lua

Put this code into the contents of both files:
cl_player.lua:

sv_player.lua:

Hope this helped :slight_smile: