|
|
Line 27: |
Line 27: |
| ''--print "456" to console.'' | | ''--print "456" to console.'' |
| }} | | }} |
| + | |
| + | {{Scripting Navbox}} |
Revision as of 08:50, 16 December 2020
The SPersistence class allows you to store persistent data to the avatar.
Members
SetValue
void SetValue
(string key, string value);
Assign the string value to the key.
Space.Persistence.SetValue("MyValue", "Hello World");
RetrieveValue
string RetrieveValue
(string key);
Returns the saved value with the key.
Space.Persistence.RetrieveValue("TestValue");
SetRegionValue
string SetRegionValue
(string key);
Save the string value to the key.
Space.Persistence.SetRegionValue("TestRegionValue","456");
RetrieveRegionValue
string RetrieveRegionValue
(string key);
Returns the saved value.
Space.Persistence.RetrieveRegionValue("TestRegionValue");
UpdateInfo
void UpdateInfo
(Closure onComplete);
Call the onComplete function upon the server saving a value.
Space.Persistence.SetValue("TestValue","123");
Space.Persistence.UpdateInfo(function ()
local value = Space.Persistence.RetrieveValue("TestValue")
Space.Log(value)
end)
--print "123" to console.
UpdateRegionInfo
void UpdateRegionInfo
(Closure onComplete);
Call the onComplete function upon the server saving a value.
Space.Persistence.SetRegionValue("TestRegionValue","456")
Space.Persistence.UpdateRegionInfo(function ()
local value = Space.Persistence.RetrieveRegionValue("TestRegionValue")
Space.Log(value)
end)
--print "456" to console.
Scripting Portal
|
|
Common
|
|
|
Key Classes
|
|
|
Helper Classes
|
|
|
Scripting samples and tutorials
|
|
|