This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
Sets the value of the key. This overwrites any existing data stored in the key.
GlobalDataStore/GetAsync|GetAsync()to retrieve a value and then setting the key with
GlobalDataStore/SetAsync|SetAsync()is risky because
GlobalDataStore/GetAsync|GetAsync()sometimes returns cached data and other game servers may have modified the key.
Articles/Lua Libraries/utf8|UTF-8. In UTF-8, values greater than 127 are used exclusively for encoding multi-byte codepoints, so a single byte greater than 127 will not be valid UTF-8 and the
GlobalDataStore/SetAsync|SetAsync()attempt will fail.
If this function throws an error, the
Articles/Datastore Errors|error message will describe the problem. Note that there are also
Articles/Datastore Errors|limits that apply to this function.
Articles/Data store|Data Stores article for an in-depth guide on data structure, management, error handling, etc.
The key identifying the entry being retrieved from the data store
The value of the entry in the data store with the given key
Reset Player Data Store
The following example is how you would generally use
GlobalDataStore/SetAsync|SetAsync(). However, if more than one server will likely be writing to this key, it’s recommended that you use