Storage
Associated namespace: sm.storage
A userdata object representing a storage object.
Note:
A storage object is accessable via `self.storage` in scripted shapes (see ShapeClass).
The storage object also allows for data to be saved in creations saved on the Lift.
Functions:
load(storage)
Server only
Loads Lua data stored in the storage object.
If no data is stored in the object, this returns nil.
Parameters:
Type | Name | Description |
---|---|---|
Storage | storage | The storage. |
Returns:
Type | Description |
---|---|
any | The data stored. |
save(storage, data)
Server only
Saves any Lua data into the storage object.
The data will remain stored after closing the world, and is retrieved using load.
Parameters:
Type | Name | Description |
---|---|---|
Storage | storage | The storage. |
any | data | The data to be stored. |