Sound Play Range

Hello guys! I need a help with a sound script,I recently released a GMod 9 Tool Gun Sound Replacement,and I spotted that the sound is being played everywhere,like it doesn’t gives any shit about a distance,can some developer help me making a sound distance play script? Thank you!

You could use to emit it from the weapon or the player, this will fade from a distance.

I read it,I didn’t understand it though