Making text only appear to players in a certain radius

How do I make text appear to players only in a certain radius, similar to RP gamemodes?

You’ll have to check against their distance from the location of the text, using
[lua]local distance = ply:GetPos():Distance( myVector )[/lua]
You can just implement it into an if like so
[lua]if ply:GetPos():Distance( myVector ) <= 500 then
// draw
end[/lua]