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

PathfindingService not moving onto the next path?

Asked by
MattVSNNL 620 Moderation Voter
3 years ago

I'm making a Dummy move to random places with pathfinding service but it's not moving onto the next Path, May anyone help me?

Script:

                local AvailableWalkParts = workspace:FindFirstChild("CustomerWalkPoints"):FindFirstChild("InsidePoints"):GetChildren()
                local walkPart1 = AvailableWalkParts[math.random(1, #AvailableWalkParts)]

                local path = pathFindingService:CreatePath()
                path:ComputeAsync(customer:FindFirstChild("HumanoidRootPart").Position, walkPart1.Position)
                local wayPoints = path:GetWaypoints()

                for i, wayPoint in pairs(wayPoints) do

                    if wayPoint.Action == Enum.PathWaypointAction.Jump then
                        customer:FindFirstChild("Humanoid").Jump = true
                    end

                    customer:FindFirstChild("Humanoid"):MoveTo(wayPoint.Position)   
                    customer:FindFirstChild("Humanoid").MoveToFinished:Wait()

                end

                local walkPart2 = AvailableWalkParts[math.random(1, #AvailableWalkParts)]

                local path1 = pathFindingService:CreatePath()
                path:ComputeAsync(customer:FindFirstChild("HumanoidRootPart").Position, walkPart2.Position)
                local wayPoints1 = path1:GetWaypoints()

                for i, wayPoint in pairs(wayPoints1) do

                    if wayPoint.Action == Enum.PathWaypointAction.Jump then
                        customer:FindFirstChild("Humanoid").Jump = true
                    end

                    customer:FindFirstChild("Humanoid"):MoveTo(wayPoint.Position)
                    customer:FindFirstChild("Humanoid").MoveToFinished:Wait()

                end

                local walkPart3 = AvailableWalkParts[math.random(1, #AvailableWalkParts)]

                local path2 = pathFindingService:CreatePath()
                path:ComputeAsync(customer:FindFirstChild("HumanoidRootPart").Position, walkPart2.Position)
                local wayPoints2 = path2:GetWaypoints()

                for i, wayPoint in pairs(wayPoints2) do

                    if wayPoint.Action == Enum.PathWaypointAction.Jump then
                        customer:FindFirstChild("Humanoid").Jump = true
                    end

                    customer:FindFirstChild("Humanoid"):MoveTo(wayPoint.Position)
                    customer:FindFirstChild("Humanoid").MoveToFinished:Wait()

                end

                local walkPart4 = AvailableWalkParts[math.random(1, #AvailableWalkParts)]

                local path3 = pathFindingService:CreatePath()
                path:ComputeAsync(customer:FindFirstChild("HumanoidRootPart").Position, walkPart2.Position)
                local wayPoints3 = path3:GetWaypoints()

                for i, wayPoint in pairs(wayPoints3) do

                    if wayPoint.Action == Enum.PathWaypointAction.Jump then
                        customer:FindFirstChild("Humanoid").Jump = true
                    end

                    customer:FindFirstChild("Humanoid"):MoveTo(wayPoint.Position)
                    customer:FindFirstChild("Humanoid").MoveToFinished:Wait()

                end
0
Nvm Just noticed the proble MattVSNNL 620 — 3y

Answer this question