I tired to make the NPC move between 4 points but he only move between point A and point B and he stuck at point B , i put the NPC out of point B but after the delay time , he still move to point B then stuck there again. Please help, here the script :
local delay_time = 3
local NPC = game.Workspace.Noob local humanoid = NPC.Humanoid
local pointA = game.Workspace.A
local pointB = game.Workspace.B
local pointC = game.Workspace.C
local pointD = game.Workspace.D
local nextTarget = pointA
while wait(delay_time) do
humanoid:MoveTo(nextTarget.Position)
humanoid.MoveToFinished:Wait()
if nextTarget==pointA then
nextTarget=pointB
end
if nextTarget ==pointB then
nextTarget=pointC
end
if nextTarget ==pointC then
nextTarget=pointD
end
if nextTarget==pointD then
nextTarget=pointA
end
end
My code start from the first "local" but AI only started realize it from "humanoid" weird :/ AND also I put this in regular script in the NPC

1 comment
You should maybe add a wait before it's next target.