so im trying to make a pathfinding script to where my npc can walk around to these different parts over and over but when i use the getChildren() function it doesnt work
script(in npc model)
local npc = script.Parent
local hum = npc:WaitForChild("Humanoid")
local PathfindingService = game:GetService("PathfindingService")
local wayPoints = game.Workspace.Waypoints
local path = PathfindingService:CreatePath()
path:ComputeAsync(npc.HumanoidRootPart.Position, wayPoints:GetChildren().Position)
for _, waypoint in pairs(path:GetWaypoints()) do
npc.Humanoid:MoveTo(waypoint.Position)
npc.Humanoid.MoveToFinished:Wait()
end
** You are now Level 10! **
👈 you