Hello devs!
so i got this npc walking script with way points and i got the error
Workspace.path.Rig.Script:8: attempt to index nil with 'Position'
can someone please tell me whats wrong? heres the script
local Humanoid = script.Parent.Humanoid
local Folder = game.Workspace.path -- put your folder name here
local loop = true -- rename it to false if you don't want it to loop
if loop then
while true do
for i, v in pairs(Folder:GetChildren()) do
Humanoid:MoveTo(Folder:FindFirstChild(i).Position)
Humanoid.MoveToFinished:Wait()
end
end
else
for i, v in pairs(Folder:GetChildren()) do
Humanoid:MoveTo(Folder:FindFirstChild(i).Position)
Humanoid.MoveToFinished:Wait()
end
end
the error is on line 8