I need help making a script that'll make an NPC on the map start following me if I'm with in 'x' distance from the NPC and will stopping following me if I get more than 'x' units away from it. I've been trying different things but nothing has worked for me.

For examples, pretty much any Roblox RPG does this.