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
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
it didnent work
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
What is your issue?
my problem is waypoints is not a valid member of Workspace "Workspace"