mcpField
R
roblox-monetization

roblox-monetization

github.com/sentinelcore开发29573 次安装35 周前更新
代码仓库

关于 roblox-monetization

面向 Roblox 开发者和设计师的指南,介绍通过游戏内购买、虚拟形象物品、Premium Payouts 和 DevEx 合规赚取 Robux。内容涵盖 Creator Hub 设置、Lua 服务端购买处理及可靠性实践。

主要功能

  1. 01Game Pass 设置与所有权检查
  2. 02可重复 Developer Product 收据处理
  3. 03UGC 物品发布流程
  4. 04Premium Payout 与 DevEx 指引
  5. 05服务端购买安全实践

适用场景

  1. 01为 Roblox 体验添加永久特权或访问权限
  2. 02通过重复购买发放金币或增益
  3. 03规划 UGC 销售与 Premium 收益
  4. 04安全处理收据重试并保存购买记录

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/sentinelcore/roblox-skills --skill roblox-monetization

安装后在 Claude Code 中输入/roblox-monetization确认已加载。

详细介绍

Roblox 变现

概览

通过 Roblox 的变现系统合法赚取 Robux 的端到端指南。涵盖面向开发者和设计师的仪表板配置与 Lua 脚本编写。

快速参考

系统用途可重复购买?最低价格
游戏通行证永久特权/访问权限否(一次性)1 Robux
开发者产品消耗品、货币、增益是(不限次数)1 Robux
UGC 物品头像市场销售不适用1 Robux
Premium 收益分成被动游戏时长收入自动无需设置

1. 游戏通行证

一次性购买即可获得永久特权。玩家在每个游戏中每种通行证只需支付一次。

仪表板设置
  1. create.roblox.com → 选择体验 → 变现 → 通行证
  2. 创建通行证 → 上传 512×512 PNG 图标,设置名称、描述和价格
  3. 保存 → 记下 通行证 ID
服务端脚本
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local PASS_ID = 000000 -- your Pass ID

-- Check ownership on join
Players.PlayerAdded:Connect(function(player)
    local success, hasPass = pcall(function()
        return MarketplaceService:UserOwnsGamePassAsync(player.UserId, PASS_ID)
    end)
    if success and hasPass then
        -- grant perk
    end
end)

-- Prompt purchase (call from server)
local function promptPass(player)
    MarketplaceService:PromptGamePassPurchase(player, PASS_ID)
end

-- Grant immediately after purchase
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, passId, purchased)
    if purchased and passId == PASS_ID then
        -- grant perk
    end
end)

始终在服务端(Script)运行,切勿使用 LocalScript — 客户端所有权检查可能被伪造。


2. 开发者产品

可重复购买的产品 — 玩家可以不限次数购买。适用于金币、药水、增益和游戏内货币。

仪表板设置
  1. Creator Hub → 体验 → 变现 → 开发者产品
  2. 创建开发者产品 → 设置名称、描述、图标和价格
  3. 记下 产品 ID
服务端脚本
local MarketplaceService = game:GetService("MarketplaceService")
local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")

local PRODUCT_ID = 000000 -- your Product ID
local coinStore = DataStoreService:GetDataStore("PlayerCoins")

local function processReceipt(receiptInfo)
    local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
    if not player then
        return Enum.ProductPurchaseDecision.NotProcessedYet
    end

    if receiptInfo.ProductId == PRODUCT_ID then
        -- Persist to DataStore FIRST — if server crashes after this line, coins are safe
        local ok, err = pcall(function()
            coinStore:UpdateAsync(tostring(player.UserId), function(current)
                return (current or 0) + 100
            end)
        end)
        if not ok then
            warn("DataStore failed:", err)
            return Enum.ProductPurchaseDecision.NotProcessedYet -- Roblox will retry
        end
        -- Now safe to update in-memory value (leaderstats, etc.)
    end

    return Enum.ProductPurchaseDecision.PurchaseGranted
end

MarketplaceService.ProcessReceipt = processReceipt

-- Prompt purchase
local function promptProduct(player)
    MarketplaceService:PromptProductPurchase(player, PRODUCT_ID)
end

ProcessReceipt 的关键规则:

  • 必须返回 PurchaseGranted 或 NotProcessedYet — 切勿静默报错
  • 返回前必须将数据持久化到 DataStore — 崩溃可能导致数据丢失
  • DataStore 失败时返回 NotProcessedYet,以便 Roblox 重试处理收据
  • 每个服务端只允许一个 ProcessReceipt 处理程序;应在其中处理所有产品 ID
  • Roblox 可能会对同一笔购买多次调用 ProcessReceipt — 如果担心重复发放,请使用 receiptInfo.PurchaseId 作为去重键

3. UGC/头像物品

在 Roblox Marketplace 中出售服装、配饰和组合包。

要求
  • 拥有 UGC Program 访问权限 — 请通过 roblox.com/create/ugc 申请
  • 已完成账户 ID 验证
  • 3D 网格物品需使用 Roblox Studio 或 Blender
工作流
  1. 设计物品(遵循 Roblox 网格/纹理规格)
  2. Creator Hub → 头像物品 → 创建 → 上传,设置类别、标签和价格
  3. 提交审核(通常需要 1–3 个工作日)
  4. 物品上线并在 Marketplace 中展示
收益比例
物品类型创作者分成
服装(T 恤、衬衫、裤子)销售额的 70%
UGC 配饰30%(订阅 Premium 后为 40%)
可转售的限量版 UGC最高 70%

4. 向客户端传达购买状态

在服务端发放产品后,通过 RemoteEvent 通知客户端,以便更新 UI(显示增益计时器、解锁按钮等):

-- Inside ProcessReceipt, after DataStore save succeeds
local NotifyClient = game:GetService("ReplicatedStorage").Remotes.PurchaseGranted
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if player then
    NotifyClient:FireClient(player, { productId = receiptInfo.ProductId })
end

5. Premium 收益分成

Roblox Premium 订阅用户在你的游戏中游玩时,你可以被动获得 Robux。无需进行任何设置。

  • Roblox 会自动追踪 Premium 会员的参与情况
  • 你每月会按 Premium 游玩时长的比例,从 Premium 收益池中获得分成
  • 查看收益:Creator Hub → 分析 → 变现 → Premium 收益分成
最大化 Premium 收益分成
  • 设计较长的游玩循环(成长进度、剧情、可重玩性)
  • 添加 Premium 专属外观或奖励,吸引 Premium 玩家

DevEx:Robux → 真实货币

资格要求:

  • 已赚取 30,000+ Robux(购买的 Robux 不计入)
  • 年满 13 岁
  • Roblox 账户已验证电子邮件地址
  • 账户没有处于有效期内的违规记录
  • 已订阅 Roblox Premium

步骤:

  1. Creator Hub → DevEx (Developer Exchange)
  2. 提交兑换申请
  3. Roblox 审核申请(通常需要 1–2 周)
  4. 通过 Tipalti 收款,汇率约为 每 Robux $0.0035(35,000 Robux 约为 $122)

**Tipalti:**首次收款前,你必须单独创建并验证 Tipalti 账户。请尽早完成设置,以免延误。


常见错误

错误解决方法
在 LocalScript 中检查所有权将检查移至服务器 Script——客户端检查可能被利用
ProcessReceipt 引发错误使用 pcall 包装逻辑;始终返回一个决策枚举值
未将购买记录保存到 DataStore玩家会在发生崩溃时丢失物品——在返回 PurchaseGranted 前先持久化数据
有多个 ProcessReceipt 处理程序每个服务器只允许一个——将所有产品逻辑合并到一个函数中
重试处理收据时重复发放使用 receiptInfo.PurchaseId 作为 DataStore 键,以检测已处理的收据
未获得计划访问权限就出售 UGC先申请加入 UGC 计划;否则上传内容会被拒绝
价格低于平台最低限价大多数物品类型的最低价格为 1 Robux
Robux 足够但 DevEx 仍受阻检查所有资格要求:年满 13 岁、已验证电子邮件、没有违规记录、已订阅 Premium,以及 Robux 是赚取而非购买所得

评论

支持 Markdown