hook.Add("PlayerCanHearPlayersVoice" , "Wat" , function( p1 , p2 ) return (p1:GetPos():Distance(p2:GetPos()) <= 2000) end )
This script was made for me a while ago. It allows players to only hear each other within 2000 units of each other when speaking via microphone.
This works well for sandbox, because when sv_alltalk is 0, the script is working, and when sv_alltalk is 1, all players on the server can hear each other from anywhere else. But a friend of mine is trying to use it in a gamemode of his and wants the different teams to be able to hear each other when they’re close enough; when sv_alltalk is 0, the script does work, but only members of the same team can hear each other within a radius while the enemy team can’t be heard no matter what.
Therefore, I think I’m just asking for a little addition to this script that makes it so all teams can hear each other regardless of sv_alltalk setting or something. I wouldn’t know how to do it, but if someone does, that really would be great. Thanks for reading, hope to hear from anybody who’s interested soon.