Humanoid:MoveTo() not working

I am trying to make an NPC that walks around, but the NPC does not move. I am not getting any errors in the output. Here is the code:
``

while wait(7.5) do

local moveToPos = {
	X = math.random(workspace["20AreaNPCRange1"].Position.X, workspace["20AreaNPCRange2"].Position.X);
	Y = 41;
	Z = math.random(workspace["20AreaNPCRange1"].Position.Z, workspace["20AreaNPCRange2"].Position.Z),
}
local vector = Vector3.new(moveToPos["X"], moveToPos["Y"], moveToPos["Z"])
script.Parent:MoveTo(vector, workspace.Part)

end

``

Any help would be appreciated

Check if there is an anchored part in the NPC.

Why are you waiting 7.5 second? Instead, wait for the Humanoid to finish the movement (be careful with the timeout).

local Seed = Random.new()
local Humanoid = script.Parent
local NPCRangeArea = workspace["20AreaNPCRange1"]
local NPCRangeArea2 = workspace["20AreaNPCRange2"]

while true do
	local moveToPos = {
		X = Seed:NextInteger(NPCRangeArea.Position.X, NPCRangeArea2.Position.X);
		Y = 41;
		Z = Seed:NextInteger(NPCRangeArea.Position.Z, NPCRangeArea2.Position.Z)
	}
	local vector = Vector3.new(moveToPos["X"], moveToPos["Y"], moveToPos["Z"])
	Humanoid:MoveTo(vector, workspace.Part)
	Humanoid.MoveToFinished:Wait()
end

I think you need to use:

Humanoid:MoveTo(vector)

Instead of:

Humanoid:MoveTo(vector, workspace.Part)