|
|
Line 1: |
Line 1: |
− | The SPersistence class allows you to store persistent data to the avatar.
| + | This page has moved to: https://docs.sine.space/v/scripting/client-scripting/scene/spersistence |
− | | + | |
− | =Members=
| + | |
− | {{ScriptFunction|void|SetValue|(string key, string value);|Assign the string value to the key.|5=Space.Persistence.SetValue("MyValue", "Hello World");}}
| + | |
− | | + | |
− | {{ScriptFunction|string|RetrieveValue|(string key);|Returns the saved value with the key.|5=Space.Persistence.RetrieveValue("TestValue");}}
| + | |
− | | + | |
− | {{ScriptFunction|string|SetRegionValue|(string key);|Save the string value to the key.|5=Space.Persistence.SetRegionValue("TestRegionValue","456");}}
| + | |
− | | + | |
− | {{ScriptFunction|string|RetrieveRegionValue|(string key);|Returns the saved value.|5=Space.Persistence.RetrieveRegionValue("TestRegionValue");}}
| + | |
− | | + | |
− | {{ScriptFunction|void|UpdateInfo|(Closure onComplete);|Call the onComplete function upon the server saving a value.|5=
| + | |
− | Space.Persistence.SetValue("TestValue","123");<br><br>
| + | |
− | Space.Persistence.UpdateInfo(function ()<br>
| + | |
− | local value = Space.Persistence.RetrieveValue("TestValue")<br>
| + | |
− | Space.Log(value)<br>
| + | |
− | end)<br>
| + | |
− | ''--print "123" to console.''
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|void|UpdateRegionInfo|(Closure onComplete);|Call the onComplete function upon the server saving a value.|5=
| + | |
− | Space.Persistence.SetRegionValue("TestRegionValue","456")<br><br>
| + | |
− | Space.Persistence.UpdateRegionInfo(function ()<br>
| + | |
− | local value = Space.Persistence.RetrieveRegionValue("TestRegionValue")<br>
| + | |
− | Space.Log(value)<br>
| + | |
− | end)<br>
| + | |
− | ''--print "456" to console.''
| + | |
− | }}
| + | |
− | | + | |
− | {{Scripting Navbox}}
| + | |