Open Road MP

mp.storage

Data that survives restarts: for the gamemode and per player (Open Road MP account). Plain JSON files in <gamemode>/data/.

get

mp.storage.get(key: string): StorageValue | undefined

A value of this gamemode's storage (kept in <gamemode>/data/storage.json, survives restarts).

Types: StorageValue

set

mp.storage.set(key: string, value: StorageValue | undefined): void

Saves a value (undefined deletes it). Written to disk within a second.

Types: StorageValue

delete

mp.storage.delete(key: string): void

Deletes a value.

keys

mp.storage.keys(): string[]

All keys of the gamemode's storage.

player

mp.storage.player(player: PlayerRef): Store

The player's own storage, by their Open Road MP account: the same data whenever they come back, under any name.

Types: Store

On this page