> For the complete documentation index, see [llms.txt](https://docs.streamavatars.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.streamavatars.com/lua-scripting-api/api-reference-and-tips/global-functions/set.md).

# set

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

    myValue = myValue + 15; --adds 15 to the local variable
    
    set('testValue', myValue) --sets the main script variable to the local variable here. **25**
end
return function()

    testValue = 10;
    
    local coroutineId = async('test');
    
    waitForCoroutine(coroutineId);
    --while waiting the async coroutine is playing it will print
    --10
    
    log(testValue); --prints 25
    log('finished');
end
```
