Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I stop an NPC before the MoveToFinished fires?

NPC.Humanoid:MoveTo(player.Character.PrimaryPart.Position)
while NPC.Humanoid.MoveToFinished:Wait() do
	wait(0.05)
	if (NPC.PrimaryPart.Position - player.Character.PrimaryPart.Position).magnitude < stopAt then
	NPC.Humanoid:ChangeState(Enum.HumanoidStateType.None) -- Here is when i want it to just stop and break the loop
	end
end

Help appreciated!

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.