stopAsync function

API - pauses the script for x amount of seconds.

function test() 
    log('test is starting');
    wait(3); --the coroutine will exit before this finishes
    log('async function completed!');
end
return function()

    
    local coroutineId = async('test');
    
    wait(1);
    --it will print: test is starting
    stopAsync(coroutineId);
    --it will NOT print async function completed!
    log('finished!')
end

Last updated