I don't know how to do this please help This is my code Oops actually deleted it since it didnt work

1 comment

0

You can create a function that traverses through each Player and calls their :DistanceFromCharacter() of our NPC. With a simple conditional statement to check their range, add them to an array of ClosestTargets, and return the first result. Perpetually call this function with a loop, and use the NPC.Humanoid:MoveTo() function to have them walk to the target.