#NPC's move weird

1 messages · Page 1 of 1 (latest)

flat totem
#
local function MoveNPC(NPC)
    task.spawn(function()
        local Humanoid = NPC:FindFirstChildOfClass("Humanoid")
        local HRP = NPC:FindFirstChild("HumanoidRootPart")
        if not Humanoid or not HRP then return end
        while NPC.Parent do
            local Destination = MoveNodes[math.random(1, #MoveNodes)].Position
            local path = PFS:CreatePath()
            path:ComputeAsync(HRP.Position, Destination)
            if path.Status == Enum.PathStatus.Success then
                for _, Waypoint in ipairs(path:GetWaypoints()) do
                    Humanoid:MoveTo(Waypoint.Position)
                    Humanoid.MoveToFinished:Wait()
                end
            end
            task.wait(math.random(2, 5))
        end
    end)
end

local TestNPC = MakeNPC()
MoveNPC(TestNPC)
#

here is the script

unkempt pagodaBOT
#

studio** You are now Level 5! **studio

flat totem
#

NVM fixed it