# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.streamavatars.com/lua-scripting-api/api-reference-and-tips/global-functions/save.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
