local player = script.Parent.TargetPlayer.Value
while true do
wait()
script.Parent.Humanoid:MoveTo(player.Torso.Position)
end
this script is a simple pathfind. i want this script to work with distance so if the player is a 20 distance away from the npc then the npc will follow the player if the player is not 12 or above distance away from the npc the npc will not follow him. how would i do that on this script?

2 comments
is targetplayer an objectvalue that represents a player?
yes