.Magnitude should be useful for you here;
You can compare things distances using it, and compare people’s locations and stuff, to points on the map;
Edit; You would need more than just that, because it counts studs and if you’re for instance a little bit more higher up it could count as more studs giving an inaccurate reading; You would need probably to set these comparators Y locations to whatever what that player’s Y location before using .Magnitude;
So like,
local newVector3 = Vector3.new(comparator.Position.X, comparator.Position.Y, HumanoidRootPart.Position.Z)
comparator.Position = newVector3
local area = (math.floor(3 / (comparator.Position + HumanoidRootPart.Position).Magnitude)) * 10
area = area - 50 -- Offset it
Attention: dummy code