Here is my code
local Pathfinding = game:GetService("PathfindingService")
local human = script.Parent:WaitForChild("Humanoid")
local Torso = script.Parent:WaitForChild("Torso")
local Path = Pathfinding:CreatePath()
Path:ComputeAsync(Torso.Position, game.Workspace.endingPart.Position)
local waypoints = Path:GetWaypoints()
for i, waypoints in pairs(waypoints) do
human:MoveTo(waypoints.Position)
human.MoveToFinished:Wait(2)
end
human:MoveTo(game.Workspace.endingPart.Position)
Here is the error
Any help is aperciate!