The code below can be added to playerinitialspawn in job.lua so when they spawn as the job/role
Code:
--To all players for k, v in pairs(player.GetAll())do --Play sound file can be .mp3 sound.Play( "ambient/explosions/exp1.wav", v:GetPos() )
end
--Whats set in this example ply:GetJob() local blacklisted_jobs = { "Civilian", "SCP001", "SCP002", "SCP003" }
for k, v in pairs(player.GetAll())do --Loop Through Blacklisted jobs for i, t in pairs(blacklisted_jobs)do --For Specific job. Depends on how gamemode set up for GetJob() function if !(v:GetJob() == t) --Play sound file can be .mp3 sound.Play( "ambient/explosions/exp1.wav", v:GetPos() )
end
end
end
I tested it. And test a EmitSound. Players hear sounds if player is next to me. But if player further away from me - doesn`t hear sounds. Need code with surface.Playsound, but it not work on jobs.lua on ex. PlayerSpawn....... closed. i make addon and it work