[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79Q18APQ5WT76WJJ9STC20C":3,"skill-same:01M79Q18APQ5WT76WJJ9STC20C":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M79Q18APQ5WT76WJJ9STC20C","roblox-simulator-economy",null,"Design, balance, and implement the economy of a Roblox simulator, tycoon, clicker, or idle game in Luau: upgrade cost curves, buy max, income per second, rebirth\u002Fprestige requirements and multipliers, offline earnings, big-number display (1.5K, 3.4M, 2.0Qa), server-authoritative purchases, repairing tampered or old save data, and odds disclosure for paid random items such as eggs, crates, and spins. Includes a Lune pacing calculator. Use when choosing or checking baseCost\u002FcostGrowth\u002Frebirth numbers, writing upgrade\u002Fcurrency\u002Frebirth\u002Foffline code, or when progress stalls, a rebirth takes far longer than the last, numbers display as 1000K, offline earnings pay too much, or players gain currency they did not earn.","JunMystery\u002FAgent-Guidance","JunMystery","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F161468934?v=4","01M79MTMV8F0BY8NK1A92RA8A0","Jun","01M79MTMWCFBKPHN5B25E6V20B",0,"MIT","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Froblox-simulator-economy\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: roblox-simulator-economy\ndescription: >\n  Design, balance, and implement the economy of a Roblox simulator, tycoon, clicker, or idle game\n  in Luau: upgrade cost curves, buy max, income per second, rebirth\u002Fprestige requirements and\n  multipliers, offline earnings, big-number display (1.5K, 3.4M, 2.0Qa), server-authoritative\n  purchases, repairing tampered or old save data, and odds disclosure for paid random items such\n  as eggs, crates, and spins. Includes a Lune pacing calculator. Use when choosing or checking\n  baseCost\u002FcostGrowth\u002Frebirth numbers, writing upgrade\u002Fcurrency\u002Frebirth\u002Foffline code, or when\n  progress stalls, a rebirth takes far longer than the last, numbers display as 1000K, offline\n  earnings pay too much, or players gain currency they did not earn.\n---\n\n# Roblox simulator economy\n\nChoose the economy's numbers with a pacing table before writing gameplay code, then implement them\nso the server owns every amount. Code targets Luau on Roblox's rolling platform APIs; the bundled\nscripts are pure Luau and were run with **Lune 0.11.0**, outside Studio.\n\n## When to use\n\n- Picking or reviewing `baseCost`, `costGrowth`, rebirth requirement and multiplier, or offline\n  cap and efficiency values for a simulator, tycoon, clicker, or idle game.\n- Writing upgrade, buy-max, currency, rebirth, or offline-earnings code in Luau.\n- Displaying large numbers, or values above about `1e15` that lose precision.\n- Adding eggs, crates, or spins bought with Robux, or with currency that can be bought with Robux.\n\n**When not to use:** DataStore reads, writes, session locking and retries → `roblox-datastores`.\nRemote protocol design and rate limiting in depth → `roblox-networking`. Shop and HUD layout →\n`roblox-ui` + `game-ui-ux`. A wave-defense economy → `tower-defense`. Engine-neutral save format\nquestions → `save-systems`.\n\n## Workflow\n\n1. **Inspect.** Find where currency, upgrade, and rebirth values live now and which scripts change\n   them. List every RemoteEvent that touches currency and what each one sends.\n2. **Write the numbers as one config table**: base income; each upgrade's `baseCost`,\n   `costGrowth`, effect, and `maxLevel`; rebirth `baseRequirement`, `requirementGrowth`,\n   `multiplierPerRebirth`; offline `maxHours`, `efficiency`. Server and client both read it.\n3. **Run the pacing calculator** from the skill directory (paths are relative to it):\n   `lune run scripts\u002Fbalance.luau --print-defaults > economy.json`, edit the file, then\n   `lune run scripts\u002Fbalance.luau economy.json`. Read the `wait` and `vs prev` columns and tune\n   until they match the targets below. `--help` lists every field and its allowed range; a\n   missing file, invalid JSON, or out-of-range field prints an error and exits 1.\n4. **Implement on the server** with the patterns below and\n   [references\u002Fserver-patterns.md](references\u002Fserver-patterns.md). Copy\n   `scripts\u002Feconomy_math.luau` unchanged into a ModuleScript so the maths you tested is the maths\n   that runs.\n5. **Verify.** `lune run scripts\u002Ftest_economy_math.luau` (exits 1 on failure) for the maths; a\n   Studio playtest with Server & Clients for purchases, rebirth, leaving and rejoining, and\n   invalid remote arguments.\n\n## Formulas\n\n| Quantity | Formula | Notes |\n|---|---|---|\n| 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 |\n| Cost from level a to b | `baseCost * g^a * (g^(b-a) - 1) \u002F (g - 1)` | Players pay the floored per-level sum, slightly less |\n| Buy max | walk real prices until the next exceeds the balance or `maxLevel` | Safer than the log formula with floored prices |\n| Rebirth requirement k | `baseRequirement * requirementGrowth ^ k` | |\n| Rebirth multiplier | `1 + k * multiplierPerRebirth` | Additive grows slowly; multiplicative (`q ^ k`) grows exponentially |\n| Offline income | `floor(min(away, maxHours * 3600) * rate * efficiency)` | Away time of 0 or less (clock went back) pays 0 |\n\nDerivations, the rebirth wait-ratio formula, and a worked example:\n[references\u002Fformulas.md](references\u002Fformulas.md).\n\n## Pacing targets (starting points, not rules)\n\n- **Early upgrades take seconds.** In the default config the first 10 levels take 3-10 s each.\n- **Each rebirth should take only a little longer than the last**, for example x1.2-x1.5. The\n  calculator's `vs prev` column is that ratio. With an additive multiplier it approaches\n  `requirementGrowth` over time, so `requirementGrowth = 3` gives x2.0 rising to x2.7 and rebirth 8\n  takes 137 days at the default income. `requirementGrowth = 1.8` gives x1.2 rising to x1.6.\n- **Offline earns less than online.** An efficiency of 0.25-0.5 and an 8-12 hour cap keep playing\n  worth more than idling without zeroing out players who log off.\n\n## Server-owned purchases\n\nA RemoteEvent carries what the player wants (\"buy upgrade `Income`\"), never an amount or a price.\nThe server looks up the price, checks the balance, spends, and grants without yielding in between.\n\n```lua\n-- ServerScriptService\u002FEconomy.server.luau (excerpt; full version in references\u002Fserver-patterns.md)\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\nlocal EconomyMath = require(ReplicatedStorage.Shared.EconomyMath)\nlocal Config = require(ReplicatedStorage.Shared.EconomyConfig)\n\nReplicatedStorage.Remotes.BuyUpgrade.OnServerEvent:Connect(function(player: Player, upgradeId: unknown)\n\tlocal session = sessions[player]\n\tif not session or type(upgradeId) ~= \"string\" then return end\n\tlocal upgrade = Config.upgrades[upgradeId]\n\tif not upgrade then return end -- unknown id\n\tlocal owned = session.levels[upgradeId] or 0\n\tif owned >= upgrade.maxLevel then return end\n\tlocal price = EconomyMath.levelCost(upgrade.baseCost, upgrade.costGrowth, owned)\n\tif EconomyMath.trySpend(session.wallet, { [upgrade.currency] = price }) then\n\t\tsession.levels[upgradeId] = owned + 1\n\tend\nend)\n```\n\n- `trySpend` checks every currency in a multi-currency cost before subtracting any, and rejects\n  negative or non-finite costs.\n- **Rebirth on the server**: compare the server's balance with the requirement, then reset wallet\n  and levels and increment the count. Never accept \"I rebirthed\" or a balance from the client.\n- Rate-limit each remote per player with a token bucket (`roblox-networking`).\n\n## Save data and offline time\n\n- **Repair on load; never error.** Use `sanitizeAmount` (non-numbers, NaN, infinity and negatives\n  become 0; fractions are floored) and `sanitizeLevel` (also clamps to the current `maxLevel`).\n  Drop unknown upgrade ids and return a list of what was repaired, so old versions and edited data\n  load cleanly.\n- **Never save NaN or infinity.** A division by zero that reaches the wallet should be caught by\n  the same sanitizers before saving.\n- **Offline time comes from the server clock only**: save `os.time()` on the server when the\n  player leaves; on join, `away = os.time() - lastSeen`. A missing or future `lastSeen` counts as\n  now, which pays nothing.\n- **Precision:** Luau numbers are doubles, exact for integers up to `2^53` (about `9e15`). If\n  balances can pass about `1e15`, store a mantissa\u002Fexponent pair or a base-10 logarithm instead.\n\n## Big-number display\n\n`EconomyMath.formatNumber(value, decimals?)` uses the suffixes K, M, B, T, Qa, Qi, Sx, Sp, Oc, No,\nDc, Ud, Dd, Td, Qad, Qid, Sxd, Spd, Ocd, Nod, Vg (`1e63`), then scientific notation.\n\n- **The rollover bug:** `999950 \u002F 1000 = 999.95`, which rounds to `\"1000.0K\"`. Round first; if the\n  rounded value reaches 1000, move to the next suffix (`\"1.0M\"`). The tests cover this case.\n- Format on the client for display only; never parse a formatted string back into a number.\n\n## Paid random items (eggs, crates, spins)\n\nRoblox's [paid random items guidelines](https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Fproduction\u002Fmonetization\u002Fpaid-random-items)\napply when a random item is bought with Robux, directly or through in-game currency bought with\nRobux. Per that page:\n\n- Show every possible outcome and its actual numerical odds, as percentages that sum to exactly\n  100%, before purchase (long decimals may be rounded, with a note that the shown total may not be\n  exactly 100%).\n- Probability modifiers such as luck boosts and pity systems are covered: explain their effect\n  numerically before purchase, and update the shown odds live while a boost is active.\n- If the full list does not fit, open it from a control labelled \"Info\" or \"Details\" that is\n  visible before purchase; an \"(i)\" icon without a word is not enough.\n- `PolicyService:GetPolicyInfoForPlayerAsync()` returns `ArePaidRandomItemsRestricted`; for those\n  players, apply one of the treatments the page lists.\n\nBuild the odds panel with `EconomyMath.oddsPercent(outcomes)` and roll on the server with\n`EconomyMath.pickWeighted(outcomes, rng:NextNumber())` from the **same** list (after applying any\nboost), so shown and actual odds cannot drift.\n\n## Pitfalls\n\n- **Rebirth 6 takes weeks** → `requirementGrowth` far above the multiplier's growth; read the\n  `vs prev` column and lower `requirementGrowth` or switch to a multiplicative multiplier.\n- **Prices outrun income after ~20 levels** → `costGrowth` of 1.5+ on an upgrade meant\n  to be bought 50 times (level 50 costs about 637 million times level 0); use 1.07-1.15.\n- **Late game breaks after a few rebirths** → multiplicative multiplier (`1.5 ^ k`) without a\n  matching requirement curve; keep `requirementGrowth \u002F q` near the ratio you want.\n- **Players gain currency they did not earn** → a remote accepts an amount or price, or the check\n  happens only on the client; send ids, price on the server.\n- **Two purchases pass one balance check** → the handler yields between check and spend; spend\n  before any `task.wait`, DataStore call, or other yield.\n- **Buy max freezes the server** → uncapped loop or a price of 0; pass `maxLevel`, keep\n  `baseCost >= 1` (`maxAffordable` errors instead of looping forever).\n- **Offline pays days of income** → client timestamp, no cap, or a corrupted `lastSeen`; use the\n  server clock, cap, and treat future times as now.\n- **HUD shows \"1000.0K\"** → `math.floor(x * 10) \u002F 10` before choosing the suffix; use\n  `formatNumber`.\n- **A save fails or loads as garbage** → NaN or infinity reached the wallet; sanitize before save\n  and on load.\n\n## Resources\n\n- `scripts\u002Fbalance.luau` — pacing calculator: per-level price, total, income and wait; per-rebirth\n  requirement, multiplier, wait and ratio; offline maximum. Run with `--help` first.\n- `scripts\u002Feconomy_math.luau` — the formulas, `trySpend`, sanitizers, odds and `formatNumber` as\n  pure Luau; runs in Lune and in a Roblox ModuleScript.\n- `scripts\u002Ftest_economy_math.luau` — tests for every function (`lune run`, exits 1 on failure).\n- [references\u002Fformulas.md](references\u002Fformulas.md) — derivations, rebirth ratio, worked example.\n- [references\u002Fserver-patterns.md](references\u002Fserver-patterns.md) — config layout, income tick,\n  buy max, rebirth, load repair with offline income, and paid random item rolls.\n\n## Related skills\n\n- `roblox-luau` — services, ModuleScripts, and the client\u002Fserver split.\n- `roblox-networking` — remote validation and token-bucket rate limits.\n- `roblox-datastores` — loading and saving the session this skill repairs.\n- `roblox-ui` — shop, upgrade, and odds panels.\n- `roblox-studio-workflow` — Server & Clients playtests.\n\n## Primary references\n\n- `https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Fproduction\u002Fmonetization\u002Fpaid-random-items`\n- `https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Fscripting\u002Fevents\u002Fremote`\n- `https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Fscripting\u002Fsecurity\u002Fclient-server-boundary`\n- `https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Freference\u002Fengine\u002Fclasses\u002FPolicyService`\n- `https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Freference\u002Fengine\u002Fdatatypes\u002FRandom`\n- `https:\u002F\u002Flune-org.github.io\u002Fdocs`\n","# Roblox simulator economy\n\nChoose the economy's numbers with a pacing table before writing gameplay code, then implement them\nso the server owns every amount. Code targets Luau on Roblox's rolling platform APIs; the bundled\nscripts are pure Luau and were run with **Lune 0.11.0**, outside Studio.\n\n## When to use\n\n- Picking or reviewing `baseCost`, `costGrowth`, rebirth requirement and multiplier, or offline\n  cap and efficiency values for a simulator, tycoon, clicker, or idle game.\n- Writing upgrade, buy-max, currency, rebirth, or offline-earnings code in Luau.\n- Displaying large numbers, or values above about `1e15` that lose precision.\n- Adding eggs, crates, or spins bought with Robux, or with currency that can be bought with Robux.\n\n**When not to use:** DataStore reads, writes, session locking and retries → `roblox-datastores`.\nRemote protocol design and rate limiting in depth → `roblox-networking`. Shop and HUD layout →\n`roblox-ui` + `game-ui-ux`. A wave-defense economy → `tower-defense`. Engine-neutral save format\nquestions → `save-systems`.\n\n## Workflow\n\n1. **Inspect.** Find where currency, upgrade, and rebirth values live now and which scripts change\n   them. List every RemoteEvent that touches currency and what each one sends.\n2. **Write the numbers as one config table**: base income; each upgrade's `baseCost`,\n   `costGrowth`, effect, and `maxLevel`; rebirth `baseRequirement`, `requirementGrowth`,\n   `multiplierPerRebirth`; offline `maxHours`, `efficiency`. Server and client both read it.\n3. **Run the pacing calculator** from the skill directory (paths are relative to it):\n   `lune run scripts\u002Fbalance.luau --print-defaults > economy.json`, edit the file, then\n   `lune run scripts\u002Fbalance.luau economy.json`. Read the `wait` and `vs prev` columns and tune\n   until they match the targets below. `--help` lists every field and its allowed range; a\n   missing file, invalid JSON, or out-of-range field prints an error and exits 1.\n4. **Implement on the server** with the patterns below and\n   [references\u002Fserver-patterns.md](references\u002Fserver-patterns.md). Copy\n   `scripts\u002Feconomy_math.luau` unchanged into a ModuleScript so the maths you tested is the maths\n   that runs.\n5. **Verify.** `lune run scripts\u002Ftest_economy_math.luau` (exits 1 on failure) for the maths; a\n   Studio playtest with Server & Clients for purchases, rebirth, leaving and rejoining, and\n   invalid remote arguments.\n\n## Formulas\n\n| Quantity | Formula | Notes |\n|---|---|---|\n| 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 |\n| Cost from level a to b | `baseCost * g^a * (g^(b-a) - 1) \u002F (g - 1)` | Players pay the floored per-level sum, slightly less |\n| Buy max | walk real prices until the next exceeds the balance or `maxLevel` | Safer than the log formula with floored prices |\n| Rebirth requirement k | `baseRequirement * requirementGrowth ^ k` | |\n| Rebirth multiplier | `1 + k * multiplierPerRebirth` | Additive grows slowly; multiplicative (`q ^ k`) grows exponentially |\n| Offline income | `floor(min(away, maxHours * 3600) * rate * efficiency)` | Away time of 0 or less (clock went back) pays 0 |\n\nDerivations, the rebirth wait-ratio formula, and a worked example:\n[references\u002Fformulas.md](references\u002Fformulas.md).\n\n## Pacing targets (starting points, not rules)\n\n- **Early upgrades take seconds.** In the default config the first 10 levels take 3-10 s each.\n- **Each rebirth should take only a little longer than the last**, for example x1.2-x1.5. The\n  calculator's `vs prev` column is that ratio. With an additive multiplier it approaches\n  `requirementGrowth` over time, so `requirementGrowth = 3` gives x2.0 rising to x2.7 and rebirth 8\n  takes 137 days at the default income. `requirementGrowth = 1.8` gives x1.2 rising to x1.6.\n- **Offline earns less than online.** An efficiency of 0.25-0.5 and an 8-12 hour cap keep playing\n  worth more than idling without zeroing out players who log off.\n\n## Server-owned purchases\n\nA RemoteEvent carries what the player wants (\"buy upgrade `Income`\"), never an amount or a price.\nThe server looks up the price, checks the balance, spends, and grants without yielding in between.\n\n```lua\n-- ServerScriptService\u002FEconomy.server.luau (excerpt; full version in references\u002Fserver-patterns.md)\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\nlocal EconomyMath = require(ReplicatedStorage.Shared.EconomyMath)\nlocal Config = require(ReplicatedStorage.Shared.EconomyConfig)\n\nReplicatedStorage.Remotes.BuyUpgrade.OnServerEvent:Connect(function(player: Player, upgradeId: unknown)\n\tlocal session = sessions[player]\n\tif not session or type(upgradeId) ~= \"string\" then return end\n\tlocal upgrade = Config.upgrades[upgradeId]\n\tif not upgrade then return end -- unknown id\n\tlocal owned = session.levels[upgradeId] or 0\n\tif owned >= upgrade.maxLevel then return end\n\tlocal price = EconomyMath.levelCost(upgrade.baseCost, upgrade.costGrowth, owned)\n\tif EconomyMath.trySpend(session.wallet, { [upgrade.currency] = price }) then\n\t\tsession.levels[upgradeId] = owned + 1\n\tend\nend)\n```\n\n- `trySpend` checks every currency in a multi-currency cost before subtracting any, and rejects\n  negative or non-finite costs.\n- **Rebirth on the server**: compare the server's balance with the requirement, then reset wallet\n  and levels and increment the count. Never accept \"I rebirthed\" or a balance from the client.\n- Rate-limit each remote per player with a token bucket (`roblox-networking`).\n\n## Save data and offline time\n\n- **Repair on load; never error.** Use `sanitizeAmount` (non-numbers, NaN, infinity and negatives\n  become 0; fractions are floored) and `sanitizeLevel` (also clamps to the current `maxLevel`).\n  Drop unknown upgrade ids and return a list of what was repaired, so old versions and edited data\n  load cleanly.\n- **Never save NaN or infinity.** A division by zero that reaches the wallet should be caught by\n  the same sanitizers before saving.\n- **Offline time comes from the server clock only**: save `os.time()` on the server when the\n  player leaves; on join, `away = os.time() - lastSeen`. A missing or future `lastSeen` counts as\n  now, which pays nothing.\n- **Precision:** Luau numbers are doubles, exact for integers up to `2^53` (about `9e15`). If\n  balances can pass about `1e15`, store a mantissa\u002Fexponent pair or a base-10 logarithm instead.\n\n## Big-number display\n\n`EconomyMath.formatNumber(value, decimals?)` uses the suffixes K, M, B, T, Qa, Qi, Sx, Sp, Oc, No,\nDc, Ud, Dd, Td, Qad, Qid, Sxd, Spd, Ocd, Nod, Vg (`1e63`), then scientific notation.\n\n- **The rollover bug:** `999950 \u002F 1000 = 999.95`, which rounds to `\"1000.0K\"`. Round first; if the\n  rounded value reaches 1000, move to the next suffix (`\"1.0M\"`). The tests cover this case.\n- Format on the client for display only; never parse a formatted string back into a number.\n\n## Paid random items (eggs, crates, spins)\n\nRoblox's [paid random items guidelines](https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Fproduction\u002Fmonetization\u002Fpaid-random-items)\napply when a random item is bought with Robux, directly or through in-game currency bought with\nRobux. Per that page:\n\n- Show every possible outcome and its actual numerical odds, as percentages that sum to exactly\n  100%, before purchase (long decimals may be rounded, with a note that the shown total may not be\n  exactly 100%).\n- Probability modifiers such as luck boosts and pity systems are covered: explain their effect\n  numerically before purchase, and update the shown odds live while a boost is active.\n- If the full list does not fit, open it from a control labelled \"Info\" or \"Details\" that is\n  visible before purchase; an \"(i)\" icon without a word is not enough.\n- `PolicyService:GetPolicyInfoForPlayerAsync()` returns `ArePaidRandomItemsRestricted`; for those\n  players, apply one of the treatments the page lists.\n\nBuild the odds panel with `EconomyMath.oddsPercent(outcomes)` and roll on the server with\n`EconomyMath.pickWeighted(outcomes, rng:NextNumber())` from the **same** list (after applying any\nboost), so shown and actual odds cannot drift.\n\n## Pitfalls\n\n- **Rebirth 6 takes weeks** → `requirementGrowth` far above the multiplier's growth; read the\n  `vs prev` column and lower `requirementGrowth` or switch to a multiplicative multiplier.\n- **Prices outrun income after ~20 levels** → `costGrowth` of 1.5+ on an upgrade meant\n  to be bought 50 times (level 50 costs about 637 million times level 0); use 1.07-1.15.\n- **Late game breaks after a few rebirths** → multiplicative multiplier (`1.5 ^ k`) without a\n  matching requirement curve; keep `requirementGrowth \u002F q` near the ratio you want.\n- **Players gain currency they did not earn** → a remote accepts an amount or price, or the check\n  happens only on the client; send ids, price on the server.\n- **Two purchases pass one balance check** → the handler yields between check and spend; spend\n  before any `task.wait`, DataStore call, or other yield.\n- **Buy max freezes the server** → uncapped loop or a price of 0; pass `maxLevel`, keep\n  `baseCost >= 1` (`maxAffordable` errors instead of looping forever).\n- **Offline pays days of income** → client timestamp, no cap, or a corrupted `lastSeen`; use the\n  server clock, cap, and treat future times as now.\n- **HUD shows \"1000.0K\"** → `math.floor(x * 10) \u002F 10` before choosing the suffix; use\n  `formatNumber`.\n- **A save fails or loads as garbage** → NaN or infinity reached the wallet; sanitize before save\n  and on load.\n\n## Resources\n\n- `scripts\u002Fbalance.luau` — pacing calculator: per-level price, total, income and wait; per-rebirth\n  requirement, multiplier, wait and ratio; offline maximum. Run with `--help` first.\n- `scripts\u002Feconomy_math.luau` — the formulas, `trySpend`, sanitizers, odds and `formatNumber` as\n  pure Luau; runs in Lune and in a Roblox ModuleScript.\n- `scripts\u002Ftest_economy_math.luau` — tests for every function (`lune run`, exits 1 on failure).\n- [references\u002Fformulas.md](references\u002Fformulas.md) — derivations, rebirth ratio, worked example.\n- [references\u002Fserver-patterns.md](references\u002Fserver-patterns.md) — config layout, income tick,\n  buy max, rebirth, load repair with offline income, and paid random item rolls.\n\n## Related skills\n\n- `roblox-luau` — services, ModuleScripts, and the client\u002Fserver split.\n- `roblox-networking` — remote validation and token-bucket rate limits.\n- `roblox-datastores` — loading and saving the session this skill repairs.\n- `roblox-ui` — shop, upgrade, and odds panels.\n- `roblox-studio-workflow` — Server & Clients playtests.\n\n## Primary references\n\n- `https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Fproduction\u002Fmonetization\u002Fpaid-random-items`\n- `https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Fscripting\u002Fevents\u002Fremote`\n- `https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Fscripting\u002Fsecurity\u002Fclient-server-boundary`\n- `https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Freference\u002Fengine\u002Fclasses\u002FPolicyService`\n- `https:\u002F\u002Fcreate.roblox.com\u002Fdocs\u002Freference\u002Fengine\u002Fdatatypes\u002FRandom`\n- `https:\u002F\u002Flune-org.github.io\u002Fdocs`\n",{"name":5,"description":7},"main","5d0a87185c0e172c3901e2a6e5916b6d544b8b94","skills\u002Froblox-simulator-economy","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance","https:\u002F\u002Fgithub.com\u002FJunMystery","AI is the typist, I am the architect. Building efficient, secure, and user-centric products through disciplined AI prompt engineering.","2026-11-13 17:41:25",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add JunMystery\u002FAgent-Guidance --skill roblox-simulator-economy",{"tool":37,"command":38},"bunx","bunx skills add JunMystery\u002FAgent-Guidance --skill roblox-simulator-economy",{"tool":40,"command":41},"pnpm","pnpm dlx skills add JunMystery\u002FAgent-Guidance --skill roblox-simulator-economy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Froblox-simulator-economy\u002FSKILL.md",true,[45,51,55,59,65,69],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"agents\u002Fopenai.yaml","REFERENCE","参考文档",229,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Froblox-simulator-economy\u002Fagents\u002Fopenai.yaml",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fformulas.md",4306,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Froblox-simulator-economy\u002Freferences\u002Fformulas.md",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fserver-patterns.md",9187,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Froblox-simulator-economy\u002Freferences\u002Fserver-patterns.md",{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"scripts\u002Fbalance.luau","SCRIPT","脚本",7249,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Froblox-simulator-economy\u002Fscripts\u002Fbalance.luau",{"path":66,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":67,"sourceHtmlUrl":68},"scripts\u002Feconomy_math.luau",7267,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Froblox-simulator-economy\u002Fscripts\u002Feconomy_math.luau",{"path":70,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":71,"sourceHtmlUrl":72},"scripts\u002Ftest_economy_math.luau",8007,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Froblox-simulator-economy\u002Fscripts\u002Ftest_economy_math.luau",[74,80,86,92,98,104],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M79QR1E309VJ6CTQKB32AWWA","zero-trust-architecture-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-architecture-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M79QQV7GHYR02DYGN41S23WN","xss-filter-evasion-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxss-filter-evasion-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M79QQNSN7YB8XB61FFSCS3WH","xs-leaks-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxs-leaks-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M79QQHZZJKFDY9132G5A65C2","xpath-injection-prevention-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxpath-injection-prevention-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M79QQB9ZSD3DJG8658EHQXR1","xml-security-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxml-security-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M79QQ60WKV7PFMXWT9CW8PM6","xml-external-entity-prevention-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxml-external-entity-prevention-cheat-sheet\u002FSKILL.md",[],[]]