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

How do i have it let me know when pathfinding is completed?

Asked by 3 years ago

how do i have it print something when pathfinding is done

i have done this with tick() but it is just to messy to deal with

1 answer

Log in to vote
0
Answered by 3 years ago

With an example like the one on the next line, you could put your code after the for loop.

for _, waypoint in pairs(waypoints) do
    local part = Instance.new("Part")
    part.Shape = "Ball"
    part.Material = "Neon"
    part.Size = Vector3.new(0.6, 0.6, 0.6)
    part.Position = waypoint.Position
    part.Anchored = true
    part.CanCollide = false
    part.Parent = game.Workspace

    -- Move zombie to the next waypoint
    humanoid:MoveTo(waypoint.Position)
    -- Wait until zombie has reached the waypoint before continuing
    humanoid.MoveToFinished:Wait()
end

--Your code here
Ad

Answer this question