/roblox-skills:roblox-data-storesfrom roblox-skills
Saves player data with session locking, builds leaderboards with OrderedDataStore, manages queues/maps with MemoryStore, and broadcasts cross-server messages via MessagingService. Use when persisting player progress, preventing data duplication, or implementing leaderboards.
Ships in roblox-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Need | Service | Notes |
|---|---|---|
| Player progress, inventory, settings | DataStore via ProfileStore (session-locked) | One key per player (User_{UserId}), ≤ 4 MB. |
| Global leaderboards | OrderedDataStore | Integer values only; periodic updates, cached reads. |
| Fast, temporary, cross-server state | MemoryStoreService | Sorted maps, queues, hash maps; everything expires (TTL ≤ 45 days). |
| Matchmaking queues, live events, server lists | MemoryStore queue / sorted map | Not durable — never the only copy of valuable data. |
| Broadcast to all servers | MessagingService | ≤ 1 kB per message, best effort, no delivery guarantee. |
| Values changed by live-ops without publishing | Experience configs (ConfigService) | See roblox-analytics-liveops. |
Two servers must never own the same player's data at once (teleports, fast rejoins), or items duplicate
and progress is lost. ProfileStore (loleris) implements session locking, auto-save, and
BindToClose flushing, and is the recommended default. Install it from Wally/the Creator Store and put
it in ServerScriptService.
-- ServerScriptService/Server/Services/DataService.luau (ProfileStore)
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
local ProfileStore = require(ServerScriptService.ServerPackages.ProfileStore)
local TEMPLATE = {
version = 1,
coins = 0,
inventory = {} :: { [string]: number },
}
type PlayerData = typeof(TEMPLATE)
local PlayerStore = ProfileStore.New("PlayerData", TEMPLATE)
local profiles: { [Player]: typeof(PlayerStore:StartSessionAsync("")) } = {}
local function onPlayerAdded(player: Player)
local profile = PlayerStore:StartSessionAsync(`User_{player.UserId}`, {
Cancel = function()
return player.Parent ~= Players -- stop waiting if the player left
end,
})
if profile == nil then
player:Kick("Could not load your data. Please rejoin.")
return
end
profile:AddUserId(player.UserId) -- GDPR / right-to-be-forgotten linkage
profile:Reconcile() -- fill in fields added to TEMPLATE since this profile was created
profile.OnSessionEnd:Connect(function()
profiles[player] = nil
player:Kick("Your data was loaded on another server. Please rejoin.")
end)
if player.Parent == Players then
profiles[player] = profile
else
profile:EndSession() -- left while loading
end
end
for _, player in Players:GetPlayers() do
task.spawn(onPlayerAdded, player)
end
Players.PlayerAdded:Connect(onPlayerAdded)
Players.PlayerRemoving:Connect(function(player)
local profile = profiles[player]
if profile then
profile:EndSession() -- saves and releases the lock
end
end)
local DataService = {}
function DataService.get(player: Player): PlayerData?
local profile = profiles[player]
return profile and profile.Data
end
return DataService
Mutate profile.Data directly on the server (it is cached in memory and auto-saved). Don't
SetAsync per change. Check the ProfileStore docs for the exact current API before relying on less
common features (global updates, MessageAsync, mock stores for Studio).
game:BindToClose.UpdateAsync over SetAsync whenever the write depends on the old value or multiple servers may
write the key. The transform function must be pure and fast (no yields); return nil to cancel.Instances, Vector3, CFrame, functions, or mixed/sparse tables: store plain tables,
numbers, strings, booleans, and buffers. Serialize datatypes ({ x, y, z }). Validate UTF-8 strings.User_{UserId}), never display names. Few data stores, few keys per player.Complete raw implementation (session lock, autosave, BindToClose, retries): references/raw-datastore.md.
| Limit | Value |
|---|---|
| Experience-wide standard reads / writes | 300 + 40 × CCU / 300 + 20 × CCU per minute (shared with Open Cloud) |
| Default per-server reads/writes | 60 + 40 × players per minute each (configurable) |
| Ordered writes per server | 30 + 5 × players per minute |
| Per-key throughput | 25 MB/min read, 4 MB/min write |
| Storage (latest versions, compressed) | 500 MB + 1 MB × lifetime users per experience |
| Queue per request type | 30 pending requests, then errors 301–306 |
UpdateAsync consumes both read and write budget.DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.StandardWrite) before
bulk work; tune per-server limits once at startup with SetRateLimitForRequestType.ListVersionsAsync, GetVersionAtTimeAsync) to restore data instead of writing backup keys.Store a version field. On load, run ordered migration functions until the data reaches the current
version, then reconcile defaults. Never delete fields in the same release that stops writing them;
never reuse field names with different meanings.
--!strict
type Data = { [string]: any }
local MIGRATIONS: { (Data) -> () } = {
[1] = function(data) -- v1 -> v2: "gold" renamed to "coins"
data.coins = data.gold or 0
data.gold = nil
end,
[2] = function(data) -- v2 -> v3: inventory list -> counts
local counts: { [string]: number } = {}
for _, itemId in data.inventory or {} do
counts[itemId] = (counts[itemId] or 0) + 1
end
data.inventory = counts
end,
}
local CURRENT_VERSION = #MIGRATIONS + 1
local function migrate(data: Data): Data
local version = data.version or 1
while version < CURRENT_VERSION do
MIGRATIONS[version](data)
version += 1
end
data.version = CURRENT_VERSION
return data
end
print(migrate({ gold = 5, inventory = { "Sword", "Sword" } }))
GetSortedAsync(false, 100) on one server loop (e.g. every 60 s), cache the
result, and replicate to clients. Don't let every server/client read constantly.Wins_2026W39) or use a MemoryStore sorted map.OrderedDataStore in Creator Hub (game →
leaderboards) and toggle "Active leaderboard"; Roblox renders persistent Global and Friends tabs in the
player list. The store stays the source of truth (one active board per game). Initialize each player's
score on join so the tabs render correctly.64 KB + 1.2 KB × users; requests 1000 + 120 × CCU units/min.MemoryStoreSortedMap: ranked data, server browsers, live leaderboards (SetAsync with expiration,
GetRangeAsync, UpdateAsync).MemoryStoreQueue: matchmaking/work queues (AddAsync, ReadAsync + RemoveAsync with the returned id
after successful processing, invisibility timeout for crash safety).MemoryStoreHashMap: high-volume key-value without sorting (SetAsync, GetAsync, UpdateAsync, ListItemsAsync).pcall + retry); keep items small.UpdateAsync retry write conflicts internally (jittered backoff, re-reading the
latest value), so the transform function can run several times: keep it pure, no side effects.600 + 240 × players sends/min; 20 + 8 × players subscriptions.SubscribeAsync/PublishAsync in pcall; they can fail or yield.More code (MemoryStore queue matchmaking, cross-server announcement, RTBF): references/memory-and-messaging.md.
Use static key patterns so automated RTBF (configured in Creator Dashboard) can delete player data
templates like PlayerData/User_{userId}. Otherwise handle the right-to-erasure webhook (see
roblox-open-cloud). Link keys to user IDs: SetAsync(key, value, { userId }), return them as the second value from an
UpdateAsync transform, or call ProfileStore's AddUserId.
roblox-security (duplication and trade exploits), roblox-monetization (receipts),
roblox-open-cloud (external access, bulk operations), roblox-teleport-matchmaking.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
roblox, datastore, session-locking, leaderboard, memorystore, messagingservice
npx claudepluginhub el4cteo/roblox-skills --plugin roblox-skills23 skills in this plugin
/roblox-analytics-liveopsAnalytics and live ops - AnalyticsService economy/funnel/onboarding/progression/custom events, player segments, experience configs via ConfigService, A/B experiments, badges, experience notifications, timed events, daily rewards, season passes. Use when instrumenting a game, tuning economy or onboarding, running A/B tests or feature flags, or planning live events and re-engagement./roblox-architectureRoblox project structure and client/server model - replication, where code and assets belong (ServerScriptService, ReplicatedStorage, StarterPlayer), RunContext, service/controller bootstrapping, player/character lifecycle, CollectionService components, attributes, streaming-safe client code, library choices. Use when starting a project, deciding where code goes, or fixing replication/streaming bugs./roblox-audioSound and music - the Audio API (AudioPlayer, AudioEmitter, AudioListener, AudioDeviceOutput, Wire, effects, faders), classic Sound/SoundGroup, 2D vs 3D audio, music and SFX volume, client vs server playback, asset permissions, streaming caveats, voice routing, text-to-speech. Use when adding music, sound effects, spatial audio, mixing, or fixing sounds that don't play./roblox-characters-animationCharacters and animation - Humanoid properties/states, spawning (LoadCharacterAsync), health and damage, HumanoidDescription appearance, Animator/AnimationTrack playback, priorities and markers, default animation replacement, Tools, TweenService, IKControl, Character Controller Library (beta). Use when changing movement, abilities, damage, respawn, avatars, animations, tweens, or tools/weapons./roblox-code-reviewReview Roblox/Luau code for exploits, data loss, memory leaks, performance problems, lifecycle bugs, policy issues, and deprecated or superseded APIs, using a severity-ranked checklist and the full 2026 deprecation map. Use when reviewing a PR or script, auditing a game before launch, modernizing legacy code, or asked what is wrong with some Roblox code./roblox-game-systemsRecipes for common systems built on server authority - currency service and leaderstats, XP/levels, round loops with intermission and teams, validated melee/ranged combat, inventory and tools, soft-currency shops, obby checkpoints, daily rewards, pets. Use when implementing or reviewing gameplay systems such as rounds, combat, weapons, inventories, shops, currencies, or progression.Other plugins' skills for the same job