roblox-datastores

roblox-datastores is a skill for Claude Code from gamedev-skills/awesome-gamedev-agent-skills. It costs 112 tokens per session (1,909 once invoked), scanned A, original, Apache-2.0.

A guide for saving Roblox player data between game sessions using Roblox's DataStoreService, including loading, saving, shutdown handling, retries, and ordered leaderboards.

In plain words
What is it for?
Use it to persist coins, inventory, levels, or other player progress, and to build leaderboards that rank stored values.
Why use it?
It helps prevent lost progress, overwritten data, and failures caused by temporary service limits. It also clarifies which code must run on the server.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the other-engines plugin — 10 skills shipped together , and of gamedev

Good fit Use it to persist coins, inventory, levels, or other player progress, and to build leaderboards that rank stored values.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gamedev-skills/awesome-gamedev-agent-skills/roblox-datastores
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-datastores
Clone the repo
git clone --depth 1 https://github.com/gamedev-skills/awesome-gamedev-agent-skills

Made for: Claude Code.

Or install other-engines, the plugin that ships this one along with the rest of its 10 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for roblox-datastores

README.md
[![agentmods](https://agentmods.dev/badge/skills/gamedev-skills/awesome-gamedev-agent-skills/roblox-datastores/github.svg)](https://agentmods.dev/skills/gamedev-skills/awesome-gamedev-agent-skills/roblox-datastores)
Your own site
<a href="https://agentmods.dev/skills/gamedev-skills/awesome-gamedev-agent-skills/roblox-datastores"><img src="https://agentmods.dev/badge/skills/gamedev-skills/awesome-gamedev-agent-skills/roblox-datastores/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for roblox-datastores

Your own site · 80×15
<a href="https://agentmods.dev/skills/gamedev-skills/awesome-gamedev-agent-skills/roblox-datastores"><img src="https://agentmods.dev/badge/skills/gamedev-skills/awesome-gamedev-agent-skills/roblox-datastores.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,909 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 9 Aug 2026
  • Snyk pass 9 Aug 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 14
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00112 $0.01909
Opus 5 $0.00056 $0.00955
Sonnet 5 $0.00022 $0.00382
Haiku 4.5 $0.00011 $0.00191

Measured 12d ago against content hash b64a11db8cee, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

roblox-datastores scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/other-engines/roblox-datastores/SKILL.md · 196 lines

How it starts

The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Roblox DataStores

Persist data across sessions in Roblox with DataStoreService: loading on join, saving on leave and shutdown, safe updates, retries, and ordered stores for leaderboards. Server-side only.

When to use

  • Use to save/load player progress (coins, inventory, levels), build persistent leaderboards, or fix data loss, overwrites, and throttling.
  • Use when server code calls DataStoreService, GetDataStore, GetAsync, SetAsync, UpdateAsync, or GetOrderedDataStore.

When not to use: general scripting, services, remotes, the client/server split → roblox-luau. High-frequency temporary state (matchmaking, per-round) → memory stores (a different service). Engine-agnostic persistence theory → save-systems.

Core workflow

  1. Enable Studio access once. File → Game Settings → Security → Enable Studio Access to API Services (use a test place; Studio hits live data). DataStores work only from server Scripts, never LocalScripts.
  2. Get a store, then read/write by key. DataStoreService:GetDataStore("Name"); key per player is usually "Player_" .. player.UserId.
  3. Wrap every call in pcall. GetAsync/SetAsync/UpdateAsync are network calls that can fail; an unguarded failure errors the thread and risks data loss.
  4. Load on PlayerAdded, save on PlayerRemoving, and also BindToClose. A leaving player and a shutting-down server both need a final save.
  5. Prefer UpdateAsync for read-modify-write (multi-server safe) over SetAsync (blind overwrite). On a failed load, do not overwrite with defaults — abort the save so you don't wipe good data.
  6. Use OrderedDataStore for ranked data (leaderboards) via GetSortedAsync. Test by joining, changing data, rejoining, and confirming it persisted.

Patterns

1. Load on join (pcall-guarded)

local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local store = DataStoreService:GetDataStore("PlayerData")

local DEFAULT = { Coins = 0, Level = 1 }

Players.PlayerAdded:Connect(function(player)
    local key = "Player_" .. player.UserId
    local ok, data = pcall(function()
        return store:GetAsync(key)
    end)

    if not ok then
        -- Load FAILED (network). Do not treat as a new player; flag so we never save
        -- over their real data with defaults.
        warn("Load failed for", player.Name, data)
        player:SetAttribute("DataLoaded", false)
        return
    end

    player:SetAttribute("DataLoaded", true)
    local profile = data or DEFAULT          -- nil == genuinely new player
    applyToLeaderstats(player, profile)
end)

Read the full file on GitHub · 196 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 196 lines · 112 tokens per session scan A b64a11db8cee

Subscribe to this mod's changes

roblox-datastores is a skill published in the GitHub repository gamedev-skills/awesome-gamedev-agent-skills (952 stars, last pushed 2d ago), licensed Apache-2.0. It adds 112 tokens to every session and 1,909 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.