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 4 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 4 years ago

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

01for _, waypoint in pairs(waypoints) do
02    local part = Instance.new("Part")
03    part.Shape = "Ball"
04    part.Material = "Neon"
05    part.Size = Vector3.new(0.6, 0.6, 0.6)
06    part.Position = waypoint.Position
07    part.Anchored = true
08    part.CanCollide = false
09    part.Parent = game.Workspace
10 
11    -- Move zombie to the next waypoint
12    humanoid:MoveTo(waypoint.Position)
13    -- Wait until zombie has reached the waypoint before continuing
14    humanoid.MoveToFinished:Wait()
15end
16 
17--Your code here
Ad

Answer this question