waitForAsync function

API - pauses the script for x amount of seconds.

function test() 
    wait(3);
    log('async function completed!');
end
return function()

    
    local coroutineId = async('test');
    
    waitForAsync(coroutineId);--pauses script
    
    --it will print async function completed before finished!
    log('finished!')
end

Last updated