Passes let you charge users a one-time Robux fee to access special privileges inside your experience, such as entry to a restricted area, an in-experience avatar item, or a permanent power-up.
Creating Passes
To create a pass:
- Go to Creations and select an experience.
- Go to Monetization ⟩ Passes.
- Click Create a Pass.
- Upload an image to display as the pass icon. Make sure the image doesn't exceed 512x512 pixels, doesn't include important details outside of its circular boundaries, and is in .jpg, .png, or .bmp format.
- Enter a name and a description for the pass.
- Click Create Pass.
Getting Pass IDs
To use scripting, you need a pass ID. To get the pass ID:
Go to Monetization ⟩ Passes.
Hover over the pass and click the ⋯ menu.
Click Copy Asset ID to copy the ID to your clipboard.
Selling Passes
You can sell passes outside or inside an experience.
Outside an Experience
To sell a pass in an experience's Store page:
- Go to Monetization ⟩ Passes.
- Hover over the pass and click the ⋯ menu.
- Select the pass you want to sell.
- Select Sales.
- Enable to Item for Sale toggle.
- In the Price in Robux field, enter the amount of Robux you want to charge users for the pass. The price you enter affects how much Robux you earn per sale. The price you enter affects how much Robux you earn per sale. The minimum price is 1 Robux, and the maximum price is 1 billion Robux.
- Click Save Changes. The pass populates in the experience's Store page.
Inside an Experience
To implement and sell a pass inside an experience, call MarketplaceService functions.
Use GetProductInfo() to retrieve information about a pass, like name and price, and then to display that pass to users. You can sell the pass inside your experience's marketplace, for example. For passes, the second parameter must be Enum.InfoType.GamePass.
local MarketplaceService = game:GetService("MarketplaceService")
-- Replace the placeholder ID with your pass ID
local productId = 000000
local success, productInfo = pcall(function()
return MarketplaceService:GetProductInfo(productId, Enum.InfoType.GamePass)
end)
if success and productInfo then
-- Check if product is for sale
if productInfo.IsForSale then
-- Display product information
-- Replace the print statements with UI code to display the pass
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
Use PromptPurchase() to prompt a pass purchase if the user doesn't already have the pass in their inventory. You can call this function when a user performs actions like pressing a button or talking to a vendor NPC.
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
-- Replace the placeholder ID with your pass ID
local passID = 0000000
-- Prompt pass purchase
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
-- Show a message telling user they already own the pass
else
-- Prompt pass purchase
MarketplaceService:PromptGamePassPurchase(player, passID)
end
end
Use PromptGamePassPurchaseFinished() to handle a completed pass prompt and purchase and assign the user the privileges associated with the pass.
Place the script inside the ServerScriptService so that the server handles the user's pass privileges.
local MarketplaceService = game:GetService("MarketplaceService")
-- Replace the placeholder ID with your pass ID
local passID = 0000000 -- Change this to your Pass ID
-- Handle a completed prompt and purchase
local function onPromptPurchaseFinished(player, purchasedPassID, purchaseSuccess)
if purchaseSuccess and purchasedPassID == passID then
print(player.Name .. " purchased the Pass with ID " .. passID)
-- Assign the user the ability or bonus related to the pass
end
end
-- Connect PromptGamePassPurchaseFinished events to the function
MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptPurchaseFinished)
Assigning Pass Privileges
You must manually assign pass privileges to users that purchase your passes. To do this, use PlayerAdded when a user joins your experience to check if they already own the pass and to assign them the pass privileges.
Place the script inside the ServerScriptService so that the server handles the user's pass privileges.
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
-- Replace the placeholder ID with your pass ID
local passID = 0000000
local function onPlayerAdded(player)
local hasPass = false
-- Check if user already owns the pass
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, passID)
end)
if not success then
-- Issue a warning and exit the function
warn("Error while checking if player has pass: " .. tostring(message))
return
end
if hasPass then
-- Assign user the ability or bonus related to the pass
print(player.Name .. " owns the Pass with ID " .. passID)
end
end
-- Connect PlayerAdded events to the function
Players.PlayerAdded:Connect(onPlayerAdded)
Pass Analytics
Use pass analytics to analyze the success of individual passes, identify trends, and forecast potential future earnings.
With analytics, you can:
- View your top passes over a selected time period.
- Showcase up to eight top-selling items on a time-series graph to analyze overall sales and net revenue.
- Monitor your catalog and sort items by sales and net revenue.
To access pass analytics:
- Go to Creations and select an experience.
- Go to Monetization ⟩ Passes.
- Select the Analytics tab.