Simply drop the following minimized code in, and BLAMMO! Only those within the defined range will be able to hear what is being said. However, as you pass the point of (max_range / falloff), characters will begin to be removed from the text, until there's nothing left! But of course, if you were to shout (LIKE THIS), then more people will be able to hear you!
Here's a quick video demonstration of the script in action...
The code is only a few lines long, so feel free to modify it with extra features to suit your own needs! If you are using this script in any capacity, I would love to hear about it! Feel free to shoot me a message on Discord, Jumpsplat120#0001.
Simply visit the github and download local_chat_v2 and utilities: https://github.com/jumpsplat120/Denizen-Scripts/