Skip to main content

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

NameTypeDescription
namestringThe name of the persistent store.
scopestringThe scope of the persistent store. (default: global)

Returns

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