get

API - gets global variables from the main coroutine.

function test() 
    wait(3);
    local myValue = get('testValue'); --gets the global object/variable testValue from the main script
    log(myValue);
end

return function()
    testValue = 10;
    async('test');
    
    wait(10);
    --it will print testValue before finished
    log('finished');
end

Last updated