I'm having an issue where the npcs will stop moving for a moment when they get too close because in the code they reached the point where my head was, but my head isn't actually in that location anymore. I think this could be fixed by making the npc move toward the direction of the player relative to the npc's head instead of trying to move the npc to the player's head, but I don't know how to do that. Please help!
I thought about it and came up with a solution.
npchumanoid:MoveTo(playerhead.Position + (playerhead.Position - npchead.Position) * 2)
The way it works is, first, it subtracts the npc head position from the player head position to get the distance. (Example: (25, 0, 25) - (10, 0, 10) = (15, 0, 15) or (25, 0, 25) - (50, 0, 50) = (-25, 0, -25)) After that it multiplies the distance by 2 to make it longer. Then it adds the multiplied distance to the player head position to put the vector value past the player's head, that way defined position is a bit behind the player's head. Basically, it creates a mirror image of the npc and puts it on the other side of the player, then the npc moves to the mirrored npc.