getMemoryStore
Gets a memory store manager.
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.getMemoryStore(name, scope);
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name of the memory store. |
scope | string | The scope of the memory store. (default: global) |
Returns
MemoryStoreManager- The memory store manager.
Example
const scores = engine.storage.getMemoryStore('scores');
await scores.set('player1', 100);
const player1Score = await scores.get('player1');
console.log('Player 1 score:', player1Score);
Available on: Client