Data Store
Common Patterns
// Store user unlocks
const unlocks: UnlockData = {
level1: true,
level2: true,
level3: false,
}
await Platform.Server.DataStore.SetKey(`Unlocks:${player.userId}`, unlocks);
// Get user unlocks
const result = await Platform.Server.DataStore.GetKey<UnlockData>(
`Unlocks:${player.userId}`,
);
if (!result) return; // Key did not exist
// Check if user has unlocked level2
if (result.level2) {
// Unlocked!
}Last updated