Roblox simulator, tycoon and idle-game economies in Luau: upgrade cost curves, income per second, rebirth pacing, big-number formatting and paid-egg odds, with a Lune calculator. Use for baseCost or rebirth numbers or unearned currency. Not for DataStores (`roblox-datastores`), remote limits (`roblox-networking`), shop layout (`roblox-ui`) or wave economies (`tower-defense`).
Ships in gamedev. 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; scripts run unread.
Choose the economy's numbers with a pacing table before writing gameplay code, then implement them
so the server owns every amount. The bundled scripts are pure Luau and run outside Studio with
Lune (install it from https://github.com/lune-org/lune/releases; lune --version to check).
baseCost,
costGrowth, effect, and maxLevel; rebirth baseRequirement, requirementGrowth,
multiplierPerRebirth; offline maxHours, efficiency. Server and client both read it.lune run scripts/balance.luau --print-defaults > economy.json, edit the file, then
lune run scripts/balance.luau economy.json. Read the wait and vs prev columns and tune
until they match the targets below. --help lists every field and its allowed range; a
missing file, invalid JSON, or out-of-range field prints an error and exits 1.scripts/economy_math.luau unchanged into a ModuleScript so the maths you tested is the maths
that runs.lune run scripts/test_economy_math.luau (exits 1 on failure) after any change
to the maths module, and re-run the calculator on the final config. In Studio, with the MCP
server connected, start play and fire the purchase handlers from execute_luau on the Server
datamodel with valid ids, unknown ids, 0/0, math.huge and negative values, then read
get_console_output and the wallet. Purchases from two players, rebirth, and leave-and-rejoin
need Server & Clients: ask the user to run them and report balances before and after.| Quantity | Formula | Notes |
|---|---|---|
| Price of the next level | floor(baseCost * costGrowth ^ owned) | 1.07-1.15 for upgrades bought many times; 1.5-3 for rare large ones |
| Cost from level a to b | baseCost * g^a * (g^(b-a) - 1) / (g - 1) | Players pay the floored per-level sum, slightly less |
| Buy max | walk real prices until the next exceeds the balance or maxLevel | Safer than the log formula with floored prices |
| Rebirth requirement k | baseRequirement * requirementGrowth ^ k | |
| Rebirth multiplier | 1 + k * multiplierPerRebirth | Additive grows slowly; multiplicative (q ^ k) grows exponentially |
| Offline income | floor(min(away, maxHours * 3600) * rate * efficiency) | Away time of 0 or less (clock went back) pays 0 |
Read references/formulas.md when you need a derivation, want to solve for a parameter instead of trying values, or must explain the calculator's output.
vs prev column is that ratio. With an additive multiplier it approaches
requirementGrowth over time, so requirementGrowth = 3 gives x2.0 rising to x2.7 and rebirth 8
takes 137 days at the default income. requirementGrowth = 1.8 gives x1.2 rising to x1.6.A RemoteEvent carries what the player wants ("buy upgrade Income"), never an amount or a price.
The server looks up the price, checks the balance, spends, and grants without yielding in between.
-- ServerScriptService/Economy.server.luau (excerpt; full version in references/server-patterns.md)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EconomyMath = require(ReplicatedStorage.Shared.EconomyMath)
local Config = require(ReplicatedStorage.Shared.EconomyConfig)
ReplicatedStorage.Remotes.BuyUpgrade.OnServerEvent:Connect(function(player: Player, upgradeId: unknown)
local session = sessions[player]
if not session or type(upgradeId) ~= "string" then return end
local upgrade = Config.upgrades[upgradeId]
if not upgrade then return end -- unknown id
local owned = session.levels[upgradeId] or 0
if owned >= upgrade.maxLevel then return end
local price = EconomyMath.levelCost(upgrade.baseCost, upgrade.costGrowth, owned)
if EconomyMath.trySpend(session.wallet, { [upgrade.currency] = price }) then
session.levels[upgradeId] = owned + 1
end
end)
trySpend checks every currency in a multi-currency cost before subtracting any, and rejects
negative or non-finite costs.roblox-networking).sanitizeAmount (non-numbers, NaN, infinity and negatives
become 0; fractions are floored) and sanitizeLevel (also clamps to the current maxLevel).
Drop unknown upgrade ids and return a list of what was repaired, so old versions and edited data
load cleanly.os.time() on the server when the
player leaves; on join, away = os.time() - lastSeen. A missing or future lastSeen counts as
now, which pays nothing.2^53 (about 9e15). If
balances can pass about 1e15, store a mantissa/exponent pair or a base-10 logarithm instead.EconomyMath.formatNumber(value, decimals?) uses the suffixes K, M, B, T, Qa, Qi, Sx, Sp, Oc, No,
Dc, Ud, Dd, Td, Qad, Qid, Sxd, Spd, Ocd, Nod, Vg (1e63), then scientific notation.
999950 / 1000 = 999.95, which rounds to "1000.0K". Round first; if the
rounded value reaches 1000, move to the next suffix ("1.0M"). The tests cover this case.Roblox's paid random items policy applies when a random item is bought with Robux, directly or through in-game currency bought with Robux. The current rules are summarized under Version notes; re-read the policy page before shipping. The implementation rule does not change: build the odds panel and the roll from one list.
Build the odds panel with EconomyMath.oddsPercent(outcomes) and roll on the server with
EconomyMath.pickWeighted(outcomes, rng:NextNumber()) from the same list (after applying any
boost), so shown and actual odds cannot drift. Check PolicyService:GetPolicyInfoForPlayerAsync() before
the spend and apply a restricted-player treatment when ArePaidRandomItemsRestricted is true.
For live tuning of prices and rewards without a server restart, and for funnel and currency
analytics, Studio's built-in rbx-configs-experimentation and rbx-instrument-analytics skills
(through the Studio MCP skill tool) cover ConfigService and AnalyticsService; this skill supplies
the numbers.
requirementGrowth far above the multiplier's growth; read the
vs prev column and lower requirementGrowth or switch to a multiplicative multiplier.costGrowth of 1.5+ on an upgrade meant
to be bought 50 times (level 50 costs about 637 million times level 0); use 1.07-1.15.1.5 ^ k) without a
matching requirement curve; keep requirementGrowth / q near the ratio you want.task.wait, DataStore call, or other yield.maxLevel, keep
baseCost >= 1 (maxAffordable errors instead of looping forever).lastSeen; use the
server clock, cap, and treat future times as now.math.floor(x * 10) / 10 before choosing the suffix; use
formatNumber.Script paths are relative to the skill directory.
scripts/balance.luau: run it (--help first) whenever you choose or change economy numbers.
Prints per-level price, total, income and wait; per-rebirth requirement, multiplier, wait and
ratio; offline maximum.scripts/economy_math.luau: copy it unchanged into a ModuleScript; read it only to look up a
function's arguments. Formulas, trySpend, sanitizers, odds and formatNumber.scripts/test_economy_math.luau: run it after any change to the maths module (exits 1 on
failure).roblox-luau — services, ModuleScripts, and the client/server split.roblox-networking — remote validation and token-bucket rate limits.roblox-datastores — loading and saving the session this skill repairs.roblox-ui — shop, upgrade, and odds panels.roblox-studio-workflow — Server & Clients playtests.Last verified: 2026-11-11.
references/formulas.md was produced with 0.11.0 and matches 0.11.1 output.ArePaidRandomItemsRestricted: give those players a listed treatment (free earnable path,
fixed disclosed order, direct purchase at expected value, hide, block with a message, or move
them away). IsPaidItemTradingAllowed: when false, those players must not trade paid outcomes.Sources: https://create.roblox.com/docs/production/monetization/paid-random-items,
https://create.roblox.com/docs/reference/engine/classes/PolicyService,
https://create.roblox.com/docs/reference/engine/datatypes/Random,
https://create.roblox.com/docs/assistant/skills,
https://github.com/lune-org/lune/releases (0.11.1, 2026-10-21).
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/gamedev:roblox-simulator-economyfrom gamedev
npx claudepluginhub cirobarone78/games-skill --plugin gamedev80 skills in this plugin
/ai-behavior-trees-utility-aiEngine-neutral behavior tree and utility AI code for NPCs in any language: Blackboard, reactive composites, decorators and response-curve scoring. Use when an enemy keeps chasing after losing sight, restarts its action every frame or flip-flops between choices. Not for FSMs, steering or pathfinding (`game-ai`) or Unreal BT, EQS and StateTree (`unreal-behavior-trees`).
/audio-designEngine-neutral game audio technique: bus layout, volume sliders in decibels, loudness, ducking music under dialogue, adaptive music and SFX variation, with Godot, Unity and FMOD/Wwise mappings. Use when mixing a game, making music react to combat, fixing repetitive footsteps or beat sync, or a mix that clips or pumps. Not for the Godot audio API (`godot-audio`).
/bevy-ecsBuilds and debugs Bevy 0.20 games in Rust: components, Query and Commands systems, schedules, States, observers and headless tests. Use when Cargo.toml depends on bevy, on a B0001 query-conflict panic, or pre-0.20 code (EventReader, SpriteBundle). Not for engine-neutral AI, generation, physics or shaders (`game-ai`, `procedural-gen`, `physics-tuning`, `shader-programming`).
/camera-systemsBuilds and tunes game cameras, engine-neutral with Godot and Cinemachine 3 mappings: 2D follow with deadzone and look-ahead, third-person orbit, first-person look and split-screen. Use when the camera lags, jitters while following, shows past the level edge, clips through walls or changes with frame rate. Not for shake (`game-feel`) or physics timestep jitter (`physics-tuning`).
/card-gameDesigns card games and deckbuilders in any engine: cards as data with one effect interpreter, deck zones, a trigger stack and seeded shuffles. Use for a Slay the Spire- or Balatro-like or a TCG, or cards that duplicate or streaky shuffles. Pair with the engine skill for card data and hand UI (`godot-resources`, `godot-ui-control`, `unity-scriptableobjects`). Not for grid crawlers (`roguelike`).
/create-game-assetsPlans, generates or sources, and validates consistent game art: style guides, sprites, pixel art, tilesets, icons and textures, with QA and licence records. Use when making or AI-generating game art, fixing fake transparency, or checking Steam AI disclosure. Not for engine import (`godot-tilemap`, `godot-animation`, `unity-tilemap-2d`), UI layout (`game-ui-ux`) or sound (`audio-design`).