Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Do I make it so an NPC will follow you but from a certain Distance?

Asked by 6 years ago

I know the :MoveTo() Function but I can't figure out how to get my NPC to follow a player if its close so for example:

local Position = script.Parent.Torso.Position
local MaxDistance = 10

How would I make it so if you are within MaxDistance (10) Studs from the npc it will follow you but if it is MaxDistance (10) away from Position it will return to Position which was its original Position?

0
You can make a 10 stud hitbox around the NPC. hiimgoodpack 2009 — 6y

Answer this question