So I've got this bit,
repeat
distance = (point - script.Parent.Torso.Position).magnitude
wait()
until script.Parent.Humanoid.MoveToFinished or distance < 4
Now, I know that it's an event, but based on what I'm doing I sort of want it in this repeat. I'm using it for a deviation of the stuff on the Pathfinding wiki page, but it moves on after you're within a certain distance of a node, which isn't working well for me, I'd like it to stop after it finishes the moveto - Is there a way to use an 'event'-type thing in a repeat until? Or a workaround?
As you can see I'm also using it with a distance so using a function to do this would just be more clunky overall. How it currently works, is that the pathfinding script will derp around as if it's finishing moving far earlier than it should be, zig-zagging but not moving around objects, which is very weird as it implies for some reason the MoveToFinished is firing off-time from when it actually stops moving.

7 comments
Just updated my question, sorry, does this still apply?
In that case you would have to use a loop.
I'm a bit confused. Use a loop? Example?
Loops in scripting or things like for, while, and repeat. I have updated my answer with a bit of a hybrid to work for both circumstances now.
That works, thanks, but weirdly that seems to not even be the part broken - the real reason I think it's not moving is, for some unknown reason, my While True Do isn't repeating. Can I PM you and get some 1-on-1 help?
Sure, I'll just need to change my inbox settings first.
Alright. PMed. Thanks for all your help.