> 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/save.md).

# save

```lua
return function()
    data = {};
    setProperty(data, 'x', 100); --set the default value to 100. If x already exists, nothing will happen!
    
    save(); --data.x gets saved as 100
    
    data.x = 300; --since we don't save after settings this, this value will be lost when loaded
    
    load(); --data.x gets reset back to 100
    
    log(data.x); --prints 100
end
```

{% hint style="info" %}
You can call save() within other coroutines, but it will save the data object from the main coroutine!
{% endhint %}
