I am following a roblox wiki tutorial but the script seems to not be working, the code is contained in a localscript inside of the npc, I get no errors when I run the game but alas the npc will not move. the npc is r6
-- Variables for the npc and its humanoid
local npc = game.Workspace.NPCmodel
local humanoid = npc.Humanoid
-- Variables for the point(s) the npc should move between
local pointA = game.Workspace.coffeeMachine
local pointB = game.Workspace.Model
-- Move the npc to the primary part of the green flag model
humanoid:MoveTo(pointA.PrimaryPart.Position)
-- Wait until the npc has reached its first target
humanoid.MoveToFinished:Wait()
-- Move the npc to the primary part of the purple flag model
humanoid:MoveTo(pointB.PrimaryPart.Position)

2 comments
Wow, I forgot to check if the hrp was unanchored, removng the primary part is not a good idea though as models themselves don't have positions so lua gets confused and doesn't know where to move
oh ye its a model