Limitations on Sound

I don’t usually drift about Facepunch very often, so excuse me if my thread is poor.

Is there someone out there who knows a way to limit how far away a sound can be heard? For instance, let’s say that we rescripted the sound emitter tool. What if we could change sound levels (lol volume) for all the sounds, as well as the distance that it can be heard from, in addition to making it sound louder whilst you walk closer to it?

I’ve been trying to script such a thing for a while, but I don’t have a clue when it comes to audio via lua. Would there be someone out there who could script a function or something along that line to accomplish this? I’ve had a friend try to help me with this, but what he produced didn’t allow clients to hear it when they walk into the radius of the emitter if they were not there when it had started emitting.

Would be quite grateful if I could get some help with this one.

:derp: