I don't know how to do this please help This is my code Oops actually deleted it since it didnt work
COMMUNITY QUESTION
How to make any Npc only attack player and how to make a follow script(I'm new :(? )
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
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.