パス は、ユーザーに特別な権限にアクセスするための一時的な Robux 料金を請求できます、例えば、制限されたエリアへの入場、経験内のアバターアイテム、または永続的なパワーアップ。
パスを作成する
パスを作成するには:
- クリエーションに移動し、エクスペリエンスを選択します。
- 移動する 収益化 > パス 。
- クリック パスを作成する 。
- パスアイコンとして表示する画像をアップロードします。画像が 512x512 ピクセルを超えない、円形の境界の外に重要な詳細を含まない、および .jpg、.png、または .bmp 形式で格納されていることを確認してください。
- パスの名前と説明を入力します。
- クリック パスを作成 。


パスIDを取得する
スクリプトをスクリプト作成用するには、パスIDが必要です。パスIDを取得するには:
移動する 収益化 > パス 。
パスのサムネイルをホバーし、 ⋯ ボタンをクリックし、コンテキストメニューから アセットIDをコピー を選択します。
パスを販売
パスを 2 つの方法で販売できます:
エクスペリエンスの内側
エクスペリエンス内でパスを実装して販売するには、MarketplaceService 関数を呼び出します。
GetProductInfo() を使用して、パスの名前や価格などの情報を取得し、そのパスをユーザーに表示します。たとえば、エクスペリエンスの市場内でパスを販売できます。パスの場合、2番目のパラメータは Enum.InfoType.GamePass でなければなりません。
local MarketplaceService = game:GetService("MarketplaceService")
-- プレースホルダー ID をパス ID で置換
local productId = 000000
local success, productInfo = pcall(function()
return MarketplaceService:GetProductInfo(productId, Enum.InfoType.GamePass)
end)
if success and productInfo then
-- 製品が販売中されているかどうかをチェック
if productInfo.IsForSale then
-- 製品情報を表示
-- 印刷文を UI コードで置き換えてパスを表示する
print("Pass Name: " .. productInfo.Name)
print("Price in Robux: " .. productInfo.PriceInRobux)
print("Description: " .. productInfo.Description)
else
print("This product isn't for sale")
end
end
ユーザーがインベントリにパスを持っていない場合、PromptPurchase() を使用してパス購持ち物リストを促すユーザーがボタンを押すなどのアクションを実行したり、ベンダーNPCと対話したりするときにこの関数を呼び出すことができます。
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
-- プレースホルダー ID をパス ID で置換
local passID = 0000000
-- 迅速なパス購入
local function promptPurchase()
local player = Players.LocalPlayer
local hasPass = false
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, passID)
end)
if not success then
warn("Error while checking if player has pass: " .. tostring(message))
return
end
if hasPass then
-- ユーザーがすでにパスを所有していることを伝えるメッセージを表示
else
-- 迅速なパス購入
MarketplaceService:PromptGamePassPurchase(player, passID)
end
end
を使用して、完了したパスプロンプトを処理し、ユーザーにパスに関連する権限を割り当てます。
スクリプトを ServerScriptService 内に配置して、サーバーがユーザーのパス権限を処理するようにします。
local MarketplaceService = game:GetService("MarketplaceService")
-- プレースホルダー ID をパス ID で置換
local passID = 0000000 -- これをパス ID に変更
-- 完了したプロンプトを処理して購入
local function onPromptPurchaseFinished(player, purchasedPassID, purchaseSuccess)
if purchaseSuccess and purchasedPassID == passID then
print(player.Name .. " purchased the Pass with ID " .. passID)
-- パスに関連するユーザーの能力またはボーナスを割り当てる
end
end
-- プロンプトゲームパス購入完了イベントを機能に接続
MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptPurchaseFinished)
あなたの経験の外部
エクスペリエンス詳細ページの ストア タブでパスを販売するには:
- 移動する 収益化 > パス 。
- パスをホバーし、 ⋯ メニューをクリックします。
- 販売したいパスを選択します。
- Select 販売 。
- 販売アイテム 切り替えを有効にする。
- Robux の価格 フィールドに、パスに対してユーザーに請求したい Robux の量を入力します。入力した価格は、販売ごとに獲得する Robux の量に影響します。入力した価格は、販売ごとに獲得する Robux の量に影響します。最低価格は 1 Robux、最高価格は 10億 Robuxです。
- クリック 変更を保存 。パスは、エクスペリエンス詳細ページの ストア タブに満たされます。
パス特権を割り当てる
パスを購入するユーザーに手動でパス特権を割り当てる必要があります。これを行うには、ユーザーがエクスペリエンスに参加するときに PlayerAdded を使用して、パスをすでに所有しているかどうかを確認し、パス権限を割り当てます。
スクリプトを ServerScriptService 内に配置して、サーバーがユーザーのパス権限を処理するようにします。
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
-- プレースホルダー ID をパス ID で置換
local passID = 0000000
local function onPlayerAdded(player)
local hasPass = false
-- ユーザーがすでにパスを所有しているかどうかをチェック
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, passID)
end)
if not success then
-- 警告を発行して機能を終了する
warn("Error while checking if player has pass: " .. tostring(message))
return
end
if hasPass then
-- パスに関連するユーザーの能力またはボーナスを割り当てる
print(player.Name .. " owns the Pass with ID " .. passID)
end
end
-- プレイヤー追加イベントを機能に接続
Players.PlayerAdded:Connect(onPlayerAdded)
パス解析
パスアナリティクスを使用して、個々のパスの成功を分析し、傾向を特定し、将来の可能な収益を予測します。
アナリティクスでは、次のことができま解析:
- 選択した期間のトップパスを表示します。
- 時系列グラフで最大 8つのトップセールアイテムを表示し、総売上と純収入を分析します。
- カタログをモニタリングし、売上と純収入でアイテムをソートします。
パスアナリティクスにアクセスするに解析:
- クリエーションに移動し、エクスペリエンスを選択します。
- 移動する 収益化 > パス 。
- 選択してください 分析 タブ。
