Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Remotely ending running functions?

Asked by 8 years ago

So, I know break can be used to end recurring loops, but what about functions? Is it possible to end a function remotely, before it's finished executing all it's lines of code? Also, what about functions being run in separate threads using Spawn()/etc?

For Example:

function Running()
    wait(7)
    for i = 1, 30 do
        print("Code hath been run")
        wait(2)
    end 
end

If I were to want/need to remotely end the function as its running for whatever reason, could I do it? And, what about functions running in separate threads? Any help is appreciated, thanks! :)

Note: The code provided is purely example code, made up on the spot. :)

Answer this question