Turn a popular game into income with game passes, developer products, and an approach that treats players like people.
Your game is live and its saves are proven. Now the question every developer eventually asks: how does this become money? Roblox handles all the payment infrastructure — you never touch a credit card. You make things want, price them, and the platform pays you. This lesson maps the money and wires up the two most common sellers: game passes and developer products.
Three ways Robux flow in a normal game:
Then DevEx (Developer Exchange) lets you swap your earned Robux for real money. It has real rules: you must be 18+, meet minimum earnings, and follow the platform rules. Treat it as a milestone, not a daily routine — most games never get there, and that's fine.
A 'Double Coins' perk a player buys once and keeps forever is a ____.
Game passes live on the Creator Dashboard under Monetization → Game Passes — create one, set a price, and Roblox gives you a numeric pass ID. Your code never holds the price; the platform does. You only prompt the sale:
local MarketplaceService = game:GetService("MarketplaceService")
local DOUBLE_COINS_PASS_ID = 123456789 -- paste your real pass ID
local function promptDoubleCoins(player)
MarketplaceService:PromptGamePassPurchase(player, DOUBLE_COINS_PASS_ID)
end
The prompt opens Roblox's own purchase dialog — you can't and shouldn't fake it. When the dialog closes, PromptGamePassPurchaseFinished tells you what happened:
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, gamePassId, wasPurchased)
if gamePassId == DOUBLE_COINS_PASS_ID and wasPurchased then
print(player.Name, "bought the Double Coins pass!")
end
end)
To check whether a already owns a pass — which is what gates the perk — ask the server:
local ownsPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, DOUBLE_COINS_PASS_ID)
Like , purchases are live-only: test them in a published game, not as a Studio shortcut. The pass is a flag; the actual double-coin logic still runs through the same server-side idle you built.
The Creator Dashboard section where you create a game pass and get its ID is Monetization → .
A coin pack is the same idea, except the can buy it over and over. The prompt is one line:
MarketplaceService:PromptProductPurchase(player, COIN_PACK_ID)
The important is what happens after. Roblox delivers a receipt to the server via the ProcessReceipt callback, and it is the server — never the client — that grants the coins:
local MarketplaceService = game:GetService("MarketplaceService")
local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local COIN_PACK_ID = 987654321 -- your developer product ID
local COINS_PER_PACK = 100
local purchaseHistory = DataStoreService:GetDataStore("PurchaseHistory")
MarketplaceService.ProcessReceipt = function(receiptInfo)
-- Keying on the purchase ID makes granting happen exactly once,
-- even if Roblox redelivers the same receipt after a hiccup.
local granted = purchaseHistory:UpdateAsync(receiptInfo.PurchaseId, function(alreadyGranted)
if alreadyGranted then
return true
end
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return nil -- not on this server yet; get redelivered later
end
local leaderstats = player:FindFirstChild("leaderstats")
local coins = leaderstats and leaderstats:FindFirstChild("Coins")
if not coins then
return nil
end
coins.Value += COINS_PER_PACK
return true
end)
return if granted == true
then Enum.ProductPurchaseDecision.PurchaseGranted
else Enum.ProductPurchaseDecision.NotProcessedYet
end
This is your data-security lesson paying rent: the purchase prompt happens on the client, but the benefit is granted by a server callback that ignores anything the client claims. And keying on receiptInfo.PurchaseId stops double-grants when a receipt is redelivered. ProcessReceipt can be set once, by one server .
Why must the coins be granted inside ProcessReceipt instead of in a client script?
Premium Payouts and DevEx happen outside your code — no , just rules and thresholds. What's fully in your hands is how you sell.
Real money means real and real rules. Keep purchases optional, visible, and honest — the best business decision in a Roblox game is also the decent one.
ProcessReceipt, server-side.PurchaseId double-grants whenever a receipt is redelivered.Next: leveling up — reading errors like a pro and growing beyond this course.