getPersistentStore
Gets a persistent store.
Scope Access
You can make the store private by setting the scope suffix to private
. This will make the store only accessible by Admin Players
and Server Scripts
.
To learn more about scopes access, see Storage Access.
Syntax
engine.storage.getPersistentStore(name, scope);
Parameters
Name | Type | Description |
---|---|---|
name | string | The name of the persistent store. |
scope | string | The scope of the persistent store. (default: global ) |
Returns
PersistentStoreManager
- The persistent store manager.
Example
const scores = engine.storage.getPersistentStore('scores');
await scores.set('player1', 100);
const player1Score = await scores.get('player1');
console.log('Player 1 score:', player1Score);
Available on: Client