Alright, for some reason I can’t get my sound file to play for everyone on the server. My code looks like this:
function PlaySound ( Ply, Cmd, Args ) local sound = Args if ( sound ) then if ( string.match( sound, "^[a-zA-Z0-9/]+.wav$" ) ) then if ( !file.Exists( "../sound/" .. sound ) ) then print( "Sound \"" .. sound .. "\" not found!" ) return end end for k, v in pairs( player.GetAll() ) do v:ConCommand( "play " .. sound ) end else print("No sound was specified yet!" ) end end concommand.Add("testsound", PlaySound);
When I run type testsound <sound path> in console, only I can hear the file being played. Any idea why the others cannot hear it? The function is on a shared file.