local zombie = script.Parent local waypoints = workspace.waypoints
for waypoint=1, #waypoints:getchildren() do zombie.Humanoid:MoveTo(waypoints[waypoint].position) zombie.Humanoid.MoveToFinished:Wait() end
The issue is that you are trying to index Waypoints with the number you get from the for loop, you should use pairs
or ipairs
for the loop.
Fixed scripts:
local zombie = script.Parent local waypoints = workspace.waypoints for WaypointIndex, Waypoint in pairs(waypoints:GetChildren()) do zombie.Humanoid:MoveTo(Waypoint.position) zombie.Humanoid.MoveToFinished:Wait() end