API:Class/GlobalDataStore

Server only:This object is server-side only! You should use a Script instead of a LocalScript when using it.
Filtered-inheritance mode: While this class technically inherits all Instance class members, some (if not all) have been hidden because they serve no purpose for this object.

ExplorerImageIndex69.pngGlobalDataStore : Object Icon.pngInstance

A GlobalDataStore exposes functions for saving and loading data for the DataStoreService. A GlobalDataStore is returned from a call to the GetGlobalDataStore method.

Functions

Functions [toggle]

RBXScriptConnectionOnUpdate ( string key, function(Variant) callback )

Sets callback as a function to be executed any time the value associated with key is changed. It is important to disconnect the connection when the subscription to the key is no longer needed.

|RMD member="API:Class/GlobalDataStore/OnUpdate"|Sets callback as a function to be executed any time the value associated with key is changed. It is important to disconnect the connection when the subscription to the key is no longer needed.|/RMD|
OnUpdate ( string key, function(Variant) callback )
Sets callback as a function to be executed any time the value associated with key is changed. It is important to disconnect the connection when the subscription to the key is no longer needed.

YieldFunctions

YieldFunctions [toggle]

VariantGetAsync ( string key )

Returns the value of the entry in the DataStore with the given key.

|RMD member="API:Class/GlobalDataStore/GetAsync"|Returns the value of the entry in the DataStore with the given key.|/RMD|
VariantIncrementAsync ( string key, int delta = 1 )

Increments the value of a particular key and returns the incremented value.

|RMD member="API:Class/GlobalDataStore/IncrementAsync"|Increments the value of a particular key and returns the incremented value.|/RMD|
voidSetAsync ( string key, Variant value )

Sets the value of the key. This overwrites any existing data stored in the key.

|RMD member="API:Class/GlobalDataStore/SetAsync"|Sets the value of the key. This overwrites any existing data stored in the key.|/RMD|
VariantUpdateAsync ( string key, function<Variant>(Variant) transformFunction )

Retrieves the value of the key from the website, and updates it with a new value.

|RMD member="API:Class/GlobalDataStore/UpdateAsync"|Retrieves the value of the key from the website, and updates it with a new value.|/RMD|
Returns the value of the entry in the DataStore with the given key.
IncrementAsync ( string key, int delta = 1 )
Increments the value of a particular key and returns the incremented value.
SetAsync ( string key, Variant value )
Sets the value of the key. This overwrites any existing data stored in the key.
UpdateAsync ( string key, function<Variant>(Variant) transformFunction )
Retrieves the value of the key from the website, and updates it with a new value.


Inherited Classes

ExplorerImageIndex69.pngOrderedDataStore
|RMD member="API:Class/GlobalDataStore"|A GlobalDataStore exposes functions for saving and loading data for the DataStoreService. A GlobalDataStore is returned from a call to the GetGlobalDataStore method. |/RMD|



See also