mcpField
R
roblox-data

roblox-data

github.com/tabooharmonyData & databases1382.0k installsUpdated 2w ago
Repository

About roblox-data

roblox-data is a reference skill for Roblox player-data persistence, aimed at developers implementing saves, migrations, retries, and session ownership. It focuses on safe DataStore workflows and lifecycle handling.

Key features

  1. 01Template-based state and migrations
  2. 02UpdateAsync and transient-error handling
  3. 03Session ownership with ProfileStore
  4. 04Lifecycle-aware saving and shutdown
  5. 05Data validation and cache verification

Use cases

  1. 01Designing versioned player save data
  2. 02Migrating existing player profiles
  3. 03Handling concurrent sessions and retries
  4. 04Verifying saves during shutdown

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/tabooharmony/roblox-brain --skill roblox-data

After installing, type/roblox-datain Claude Code to confirm it loaded.

Bundled filesreferences/full.md

Details

From the project README

roblox data persistence

When to Load

Load for player saves, migrations, retries, shutdowns, or session ownership. Leaderboards/messaging/world data: roblox-server-data; Open Cloud: roblox-cloud.

Quick Reference

  • Define a serializable template and a version field before storing player state. Deep-copy templates so nested defaults are not shared; migrate, then reconcile missing fields against the template. Scope store names by environment (PlayerData_Studio) so Studio writes stay out of production.
  • Use UpdateAsync for read-modify-write; handle throttling and transient errors.
  • Prevent concurrent profile mutation with a session-ownership protocol.
  • With ProfileStore: StartSessionAsync, Profile.OnSessionEnd, EndSession as documented; no Steal for normal loads; ProfileStore.Mock for ephemeral Studio writes.
  • Save on meaningful changes and lifecycle boundaries; PlayerRemoving alone is not sufficient; BindToClose finishes pending work.
  • Store primitives/arrays/dictionaries; convert Instances/userdata/functions/cyclic tables first. Validate numbers (no NaN/inf), strings (utf8.len), nested tables: one bad value fails the write.
  • RTBF: keep the user ID as a static substring in keys (player_<UserId>) so {UserId} deletion templates match; hashed/random keys make erasure manual.
  • GetAsync serves a 4-second local cache (DataStoreGetOptions.UseCache, default true); verify writes with UseCache = false.
  • Poll DataStoreService:GetRequestBudgetForRequestType for live headroom; quotas scale with concurrent users (experience reads: 300 + CCU x 40/min).
  • New code identifies users with player.User (User.Id, DomainType, DomainId); UserId remains valid, but never mix the two IDs in one key scheme.
  • First-session traces: roblox-analytics §8.

Persistence workflows: references/full.md

Comments

Markdown supported