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

How would I make my NPC move?

Asked by 9 years ago
local p = script.Parent
local dis = 30

while true do wait()
    for i,v in pairs(game.Players:GetChildren()) do
        if (p.Torso.Position-v.Character.Torso.Position).magnitude <= dis then
            script.Parent.Humanoid:WalkToPart(v.Character.Torso)
            print("Walking")
        end
    end
end
0
Umm...what exactly is the problem here? Everything in the script looks fine. dyler3 1510 — 9y

Answer this question