New: BloxMaps v4 is out: our biggest upgrade yet. Full Roblox games from one prompt, new Build A ___ Empire games, music in every game
Guide

How to make game passes and developer products

Game passes and developer products are how Roblox games sell things for Robux. This guide shows how to create both in Creator Hub, find their IDs, show the purchase prompt, and grant what players bought, safely, with scripts you can copy.

Updated · by the BloxMaps team

Game pass or developer product?

Game passDeveloper product
BoughtOnce, kept foreverAgain and again
Good forVIP, 2x coins, a special tool, an extra pet slotCoin packs, a stage skip, a revive, a short boost
How your game knowsAsk Roblox if the player owns itRoblox sends a receipt your script must handle

Before you start

  • Publish your game first (File > Publish to Roblox in Studio). Passes and products belong to a published experience.
  • Make a square icon for each item, at most 512x512 pixels. Roblox shows it in a circle, so keep the important part in the middle.
  • All the scripts below go in server Scripts (ServerScriptService), except the button, which is a LocalScript.

Create a game pass

  1. Open Creator Hub > Creations and select your game.
  2. Go to Monetization > Passes and click Create a pass.
  3. Upload the icon, enter a name and a description, and create it.
  4. Open the pass's settings to put it on sale and set the price in Robux.
  5. Back in the list, hover over the pass, open its ⋯ menu and choose Copy Asset ID. That number is the pass ID your scripts use.

Roblox's passes guide has the current screens.

Create a developer product

  1. In Creator Hub, select your game and go to Monetization > Developer Products.
  2. Click Create a developer product, upload the icon, enter a name and a description.
  3. Set the price in Robux and save.
  4. Copy the product's ID the same way (the ⋯ menu, Copy Asset ID).

Details are in Roblox's developer products guide.

Show the purchase prompt

A shop button only asks Roblox to show its purchase window. Put a LocalScript inside a TextButton or ImageButton:

local MarketplaceService = game:GetService("MarketplaceService")
local player = game:GetService("Players").LocalPlayer

local VIP_PASS_ID = 0    -- your pass ID
local COINS_100_ID = 0   -- your developer product ID

script.Parent.Activated:Connect(function()
	MarketplaceService:PromptGamePassPurchase(player, VIP_PASS_ID)
	-- for a developer product:
	-- MarketplaceService:PromptProductPurchase(player, COINS_100_ID)
end)

The button never gives the item itself. Roblox handles the payment, then tells your server, which grants it. That's what stops exploiters from giving themselves things for free.

Grant a game pass

Check ownership when a player joins, and again right after they buy it in-game:

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local VIP_PASS_ID = 0 -- your pass ID

local function giveVip(player)
	player:SetAttribute("VIP", true) -- your game reads this: a gold name, a VIP room, 2x coins...
end

Players.PlayerAdded:Connect(function(player)
	local ok, owns = pcall(function()
		return MarketplaceService:UserOwnsGamePassAsync(player.UserId, VIP_PASS_ID)
	end)
	if ok and owns then
		giveVip(player)
	end
end)

MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, passId, purchased)
	if purchased and passId == VIP_PASS_ID then
		giveVip(player)
	end
end)

You don't need to save game passes yourself: Roblox remembers who owns them, so the check on join is enough.

Grant a developer product with ProcessReceipt

Developer products are different: Roblox calls a function you set, ProcessReceipt, and keeps calling it until you say the item was given. Roblox's docs put the rule plainly: it "can only be done once by one server-side script". So handle every product in one place:

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local COINS_100_ID = 0 -- your product IDs
local SKIP_STAGE_ID = 0

local handlers = {
	[COINS_100_ID] = function(player)
		player.leaderstats.Coins.Value += 100
	end,
	[SKIP_STAGE_ID] = function(player)
		player.leaderstats.Stage.Value += 1
		player:LoadCharacter()
	end,
}

MarketplaceService.ProcessReceipt = function(receipt)
	local player = Players:GetPlayerByUserId(receipt.PlayerId)
	local handler = handlers[receipt.ProductId]
	if not player or not handler then
		return Enum.ProductPurchaseDecision.NotProcessedYet -- Roblox will try again later
	end
	local ok = pcall(handler, player)
	if not ok then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

Three rules that prevent almost every bug:

  • Only one script sets ProcessReceipt. A second one silently replaces the first, and those purchases stop working.
  • Return PurchaseGranted only after the item is given. If anything fails, return NotProcessedYet and Roblox retries, for example the next time the player joins.
  • Don't grant products from PromptProductPurchaseFinished. That event fires when the window closes, which doesn't mean a purchase went through.

For coins and other saved items, also save the player's data soon after granting, and keep a record of each receipt.PurchaseId you've handled (in a DataStore) so a retry never grants twice.

Test purchases

In Studio's Play mode, purchases are test purchases: the window says so, no Robux are spent, and your scripts run exactly as they would for real. Test every item: buy it, check the player got it, leave and rejoin to check passes and saved items are still there.

What to sell, and for how much

  • Sell convenience and style, not winning. 2x coins, auto collect, cosmetics and VIP areas feel fair. Items that make paying players impossible to beat drive everyone else away.
  • Have something cheap. A small product gives players an easy first purchase.
  • Paid random items must show their odds before purchase (Roblox's rules), for example an egg or a crate bought with Robux.
  • Look at similar games to see what players expect to pay, then test and adjust.

Roblox keeps a share of each sale, and creators can exchange earned Robux for money only under Roblox's Developer Exchange rules: see Roblox's monetization docs for the current terms. Nobody can promise how much a game will sell. If you're under 18, involve a parent or guardian in anything to do with real money.

In a BloxMaps game

Games from the BloxMaps Game Maker come with the shop and these scripts already in place: passes and developer products that fit the game (VIP, 2x currency, boosts and more), buttons that show the purchase prompt, and the granting done on the server. The one thing a file can't do for you is create the items on your Roblox account, so after publishing you:

  1. open the game's list of shop items in Studio (it lists each item's name, price and what it gives);
  2. create each one in Creator Hub as above, with the same name and price;
  3. paste the pass IDs into the list, and publish again.

Until an item has its ID, players simply don't see it, so nothing looks broken. Our How to publish page shows exactly where the list is. Want to see what a generated shop looks like first? Start from a game idea, or read the full beginner guide.

Questions

What's the difference between a game pass and a developer product?

A game pass is bought once and kept forever (like VIP). A developer product can be bought again and again (like a coin pack or a stage skip).

How do I find a game pass ID?

In Creator Hub, open your game, go to Monetization > Passes, open the menu on the pass and copy its asset ID.

Why didn't my developer product give the item?

Usually because ProcessReceipt is missing, is set in more than one script, or doesn't return PurchaseGranted. Only one server script may set it.

Can I test purchases without spending Robux?

Yes. Purchases made while testing in Studio are test purchases and don't cost Robux.

Do BloxMaps games come with these set up?

Games from the Game Maker include a shop that already prompts the purchases. You make the passes and products in Creator Hub and add their IDs; How to publish walks through it.

Make a Roblox game from one sentence

Describe your idea. Get the map, UI, shop and gameplay in one Roblox Studio file. Free to build and preview.

Make a gameFree to try