Help Needed with NEXTBOT

I’m messing around with NEXTBOT trying to get an npc that a player can command around in an RTS style, So far I’ve had luck and everything works as it should, the trouble I’m having is getting the bot to find a new path before finishing the first one given to it.

The problem is that I can’t find a way to tell it to stop going to where it’s going before it gets there, and go somewhere else…
So my question is does any function to cancel the MoveToPos command exist?

Override the old MoveToPos command and create an if statement that leads to a return based on a variable defined in the entity.



if npc.StopMoving then
 npc.StopMoving = nil
 return "ok"
end

Thanks, This works perfectly