I can't find a function for this on the wiki, I need it for a user-input system on my WIP hacking game.
✓ ANSWER ACCEPTED
Is there a way to halt a for-loop without breaking?
1 answer
✓ Accepted answer
break is the way to break a loop. return also works (but obviously has extra functionality of completely exiting a function block instead of just a loop and giving a [set of] value[s]).
The only other way to prevent a loop from continuing is to cause its condition to be false, but in the context of a for loop that is essentially impossible.
I suppose a third way to stop it would be an error. Those break execution all the way up to the next protected call (pcall, ypcall, xpcall), which is obviously a horrible way to manage your code but maybe something interesting could come of it.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Thanks for the answer, I just thought of a horridly ugly way to fix my problem. it won't be pretty, but it might work.
What is your problem? Maybe I could provide some insight
I fixed it.