I was planning that my seed script project can have a line of code that can stop a function from continuing. Sorry this description is stub. But anyways to pause a function?
COMMUNITY QUESTION
How to stop a function from continuing?
1 answer
Assuming this is just for debugging and you still have code afterwards, you can do
local function foo()
print("hello")
do
return
end
print("world")
end
foo()
and that will only print hello.
The reason this works is because return only needs no more code after it in its scope.
Hope this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Functions will stop after it completes its task. Did you mean a loop? You can use "break" inside the loop.
https://scriptinghelpers.org/questions/63816/why-do-some-people-use-break-and-others-return-end