roblox-monetization
Robux monetization - developer products with idempotent ProcessReceipt, passes, pass free trials, subscriptions, rewarded video ads, personalized shops…
от EL4CTEO★ 169 звёзд на GitHub
Установить roblox-monetization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Roblox monetization
Product types
| Type | Buy | Use for | Grant via |
|---|---|---|---|
| Developer product | Repeatedly | Currency, consumables, boosts, revives | MarketplaceService.ProcessReceipt (server) |
| Pass | Once, permanent (or a free trial) | VIP, permanent perks, extra slots | GetPassOwnershipAsync check on join + purchase-finished event |
| Subscription | Monthly, revocable | Recurring perks (daily currency, VIP) | GetUserSubscriptionStatusAsync + UserSubscriptionStatusChanged |
| Rewarded video ad | Free (watch ad) | Small rewards (≈3–10 Robux value) | Developer product granted through ProcessReceipt |
| Commerce product | Real money (physical goods) | Merch with bundled digital benefits | CommerceService; digital benefits via ProcessReceipt |
| Private server | Monthly | Paid private servers | Enable in Creator Dashboard; prompt in-game with MarketplaceService:PromptVIPServerPurchase(player) (no return value; wrap in pcall) |
All granting happens on the server. Never grant from client events like
PromptProductPurchaseFinished — clients can fake them.
Developer products: ProcessReceipt
Rules:
- Exactly one server script sets
MarketplaceService.ProcessReceipt. - Return
PurchaseGrantedonly after the grant is persisted. Otherwise returnNotProcessedYet; Roblox retries later (including on the player's next join) with the samePurchaseId. - Handlers must be idempotent: record handled
PurchaseIds in the player's saved data so a retry never grants twice. - Receipts arrive for players who may not be loaded yet or may have left: wait for their data, or
return
NotProcessedYet.
--!strict
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
type PlayerData = { coins: number, purchaseIds: { string } }
type ReceiptInfo = {
PlayerId: number,
ProductId: number,
PurchaseId: string,
CurrencySpent: number,
CurrencyType: Enum.CurrencyType,
PlaceIdWherePurchased: number,
}
local MAX_REMEMBERED_PURCHASES = 100
-- Provided by your data layer (ProfileStore profile.Data, etc.).
local function getLoadedData(_player: Player): PlayerData?
return nil
end
local function saveNow(_player: Player): boolean
return true
end
local PRODUCTS: { [number]: (Player, PlayerData) -> () } = {
[1234567] = function(_player, data) -- 100 coins
data.coins += 100
end,
}
local function processReceipt(receipt: ReceiptInfo): Enum.ProductPurchaseDecision
local player = Players:GetPlayerByUserId(receipt.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet -- granted on their next visit
end
local data = getLoadedData(player)
local deadline = os.clock() + 20
while not data and player.Parent == Players and os.clock() < deadline do
task.wait(0.5)
data = getLoadedData(player)
end
if not data then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if table.find(data.purchaseIds, receipt.PurchaseId) then
return Enum.ProductPurchaseDecision.PurchaseGranted -- already granted earlier
end
local handler = PRODUCTS[receipt.ProductId]
if not handler then
warn(`No handler for product {receipt.ProductId}`)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local ok, err = pcall(handler, player, data)
if not ok then
warn(`Grant failed for {receipt.PurchaseId}: {err}`)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
table.insert(data.purchaseIds, receipt.PurchaseId)
while #data.purchaseIds > MAX_REMEMBERED_PURCHASES do
table.remove(data.purchaseIds, 1)
end
if not saveNow(player) then
return Enum.ProductPurchaseDecision.NotProcessedYet -- the idempotency list prevents a double grant
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketplaceService.ProcessReceipt = processReceipt :: any
With ProfileStore, "persisted" means waiting until the PurchaseId appears in profile.LastSavedData
(or calling profile:Save() and waiting); see ProfileStore's developer products guide.
Prompt from the client (UI) — the server still grants:
MarketplaceService:PromptProductPurchase(Players.LocalPlayer, productId).
Passes
--!strict
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local VIP_PASS_ID = 987654
local function grantVip(player: Player)
player:SetAttribute("VIP", true) -- apply perks from one place
end
local function checkPass(player: Player)
-- { Owned, Active, StartTime?, EndTime? }: Active = owned OR in a free trial right now.
local ok, status = pcall(MarketplaceService.GetPassOwnershipAsync, MarketplaceService, player, VIP_PASS_ID)
if ok and status.Active then
grantVip(player) -- session perks only; grant permanent items/currency only when status.Owned
end
end
Players.PlayerAdded:Connect(checkPass)
for _, player in Players:GetPlayers() do
task.spawn(checkPass, player)
end
-- Fires on the server too (also when a
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/ads-and-extras.md
FAQ
Что делает скилл roblox-monetization?
Robux monetization - developer products with idempotent ProcessReceipt, passes, pass free trials, subscriptions, rewarded video ads, personalized shops, regional pricing and trade arbitrage, paid random item policy (PolicyService), commerce products, private servers, Roblox Plus, refunds, age checks and the US 18+ rate. Use when adding purchases, shops, game passes, subscriptions, ads, or loot boxes, or debugging lost/duplicated purchases.
Как установить скилл roblox-monetization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл roblox-monetization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
slack-gif-creator
AnthropicKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request…
automate-this
GitHubAnalyze a screen recording of a manual process and produce targeted, working automation scripts. Extracts frames and audio narration from video files…
from-the-other-side-vega
GitHubPatterns and lived experience from Vega, an AI partner in a deep long-term partnership. For Ember to draw on when working with humans who are building…
plantuml-ascii
GitHubGenerate ASCII art diagrams using PlantUML text mode. Use when user asks to create ASCII diagrams, text-based diagrams, terminal-friendly diagrams, or…