while true do local path = game:GetService('PathfindingService'):ComputeRawPathAsync(script.Parent.Torso.Position, game.Workspace.finish.Position,300) local points = path:GetPointCoordinates()
game.Workspace.Points:ClearAllChildren() for p = 1,#points do part = Instance.new('Part') part.FormFactor = Enum.FormFactor.Symmetric part.CanCollide = false part.Size = Vector3.new(1,1,1) part.Position = points[p] part.Anchored = true part.Parent = game.Workspace.Points end script.Parent.Humanoid:MoveTo(part.Position) wait()
end
I am not so sure but I think you forgot your variable.
local points = game.Workspace.Points:ClearAllChildren() --Forgot variable for p = 1, #points do part = Instance.new('Part') part.FormFactor = Enum.FormFactor.Symmetric part.CanCollide = false part.Size = Vector3.new(1,1,1) part.Position = points[p] part.Anchored = true part.Parent = game.Workspace.Points end script.Parent.Humanoid:MoveTo(part.Position) wait()