My code isn't working?

Hello, I am trying to make a thing where the player creates paths and an NPC follows them. The NPC is not following them.
Spawning the paths–

local point1pos = game:GetService("ReplicatedStorage").Point1Position.Value

local pointnum = game:GetService("ReplicatedStorage").PointNumber.Value
local point = game:GetService("ReplicatedStorage").Point

local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()

local mouse = player:GetMouse()
local mousepos = mouse.Hit.Position

mouse.Button1Down:Connect(function()
	point1pos = mousepos
	mousepos = mouse.Hit.Position
	local part = point:Clone()
	part.Parent = workspace.Folder
	part.Position = mousepos
	part.Name = ("Point"..pointnum)
	pointnum += 1
end)

Spawning the NPC–

local point1pos = game:GetService("ReplicatedStorage").Point1Position.Value

local button = script.Parent

button.Activated:Connect(function()
	local NPC = game:GetService("ReplicatedStorage").Bob:Clone()
	NPC.Parent = workspace
	wait(.5)
	NPC:MoveTo(workspace.Folder:WaitForChild("Point1").Position)
end)

NPC pathfind–

local ps = game:GetService("PathfindingService")
local humanoid = script.Parent.Parent.Humanoid

wait(1)
for i, v in pairs(workspace.Folder) do
	humanoid:MoveTo(v.CFrame)
	wait(1)
end

Somebody please help.

Instead, you should be doing:

for i,v in pairs(workspace.Folder:GetChildren()) do

Hope this helped!

I think this is the solution but it turns out my npc script isn’t even running?

Which npc script? I see 2 in your first post.

The script for the npc to pathfind

Check the output for errors. If there are none, use print() while it is looping through the folder’s contents.

There are no errors and I already did that but no output.

is the npc’s humanoidrootpart unanchored

Yes but the script is not even running

put print statement on very top of script

Make “NPC pathfind” script disabled and let “Spawning the NPC” enable the script after the NPC is parented to the workspace.

I didn’t get any output from it.

Ok I just tried that and it didn’t do anything.