A gamepass is a one-time purchase that gives players permanent access to something in your game

When you create a gamepass in Roblox, you are selling a permanent unlock — not a consumable item that disappears after use. A player buys it once, and they keep the benefit forever in that game. This is different from a developer product, which players can buy multiple times (like in-game currency or healing potions).

Gamepasses live in your game's store. Players find them on the game's main page, click to purchase, and the gamepass stays in their inventory. You set the price in Robux (Roblox's in-game currency), and Roblox takes a cut — currently 30 percent — leaving you with 70 percent of what players spend.

The actual work happens in two places: you create the gamepass itself in the Roblox Creator Hub, then you write code in your game to detect when a player owns it and give them the benefit you promised.

Key Takeaways

  • You create the gamepass listing in the Creator Hub under your game's settings, set a price in Robux, and publish it before players can see it.
  • In your game's code, you use the MarketplaceService to check whether each player owns the gamepass when they join or perform an action.
  • The gamepass ID is a number you copy from the Creator Hub and paste into your script — without it, your code cannot find the gamepass.
  • Test your gamepass in Roblox Studio before publishing your game, using a test account to confirm the purchase detection works.
  • Roblox keeps 30 percent of gamepass sales; you receive 70 percent as Robux that you can cash out or spend on ads.

Creating the gamepass in the Creator Hub

Log into the Roblox Creator Hub at create.roblox.com. On the left sidebar, click Creator Dashboard, then find your game in the list and click it. In the game's settings menu, look for Monetization or Passes (the exact name varies by when your account was created, but it is always in the left sidebar under your game's name).

Click the button to create a new gamepass. You will enter a name (something like "No Ads" or "Double XP"), write a description that explains what the player gets, and upload an image. The image appears in the store, so make it clear and readable at small size. Roblox recommends 512 by 512 pixels.

Set your price in Robux. There is no minimum or maximum, but most gamepasses range from 50 to 500 Robux. Lower prices sell more copies; higher prices work only if the benefit is genuinely valuable. Click Create or Publish. The gamepass now exists, but it will not appear in your game's store until you add code to detect it.

Copy the gamepass ID from the Creator Hub — it is a long number shown on the gamepass's page. You will paste this into your game's script. Write it down or keep the browser tab open; you need the exact number.

Writing the code to detect gamepass ownership

Open your game in Roblox Studio. You need a script that runs when a player joins and checks whether they own the gamepass. The script uses MarketplaceService, which is Roblox's built-in system for checking purchases.

In ServerScriptService (a folder that exists in every new game), create a new Script. Paste this code, replacing YOUR_GAMEPASS_ID with the number you copied from the Creator Hub:

local MarketplaceService = game:GetService("MarketplaceService") local gamepassID = YOUR_GAMEPASS_ID game.Players.PlayerAdded:Connect(function(player)   local hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassID)   if hasPass then     -- Give the player the benefit here     print(player.Name .. " owns the gamepass")   end end)

This code runs every time a player joins. It asks MarketplaceService whether that player's user ID owns the gamepass. If they do, the code inside the if hasPass then block runs. That is where you add your own code — for example, giving them a special tool, multiplying their XP gain, or unlocking a game mode.

The UserOwnsGamePassAsync function is asynchronous, meaning it takes a moment to check the Roblox servers. That is why it says "Async" — your game does not freeze while waiting for the answer. Always use this function, not the older synchronous version.

Adding the actual benefit to your game

The code above only detects ownership. You still need to decide what the gamepass unlocks. Common examples: a tool that appears in the player's backpack, a stat multiplier (like 2x damage), a cosmetic item, or access to a special area.

If your gamepass gives a tool, you might add this inside the if hasPass then block:

local tool = game.ServerStorage.SpecialTool:Clone() tool.Parent = player.Backpack

This clones a tool from ServerStorage (where you store templates) and puts it in the player's backpack. If your gamepass multiplies XP, you might set a value in the player's data that other scripts check when awarding XP.

The key is that your benefit code must run inside the if hasPass then block, so it only happens for players who actually own the gamepass. If you put it outside the block, every player gets it, and you have given away your gamepass for free.

Testing before you publish

In Roblox Studio, click Run to start a test server. Your character will spawn in the game. Open the command bar (press F9) and type this command to give your test character the gamepass without paying:

game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, YOUR_GAMEPASS_ID)

Replace YOUR_GAMEPASS_ID with your actual gamepass ID. A purchase dialog will appear. Click Purchase. The dialog will fail (because you are in Studio, not the live game), but the important part is that your code should now detect the gamepass and trigger the benefit. Check the Output window (View > Output) to see if your print statement ran.

If the benefit did not appear, check three things: the gamepass ID is correct, the code is inside the if hasPass then block, and there are no errors in the Output window. Common mistakes are typos in the gamepass ID and forgetting to set the parent of an object (so it never appears in the game).

Once the test works, publish your game. The gamepass will appear in your game's store when ready. Real players can now purchase it.

Understanding the payment split and cashing out

When a player buys your gamepass for 100 Robux, Roblox keeps 30 Robux and you receive 70 Robux. The money goes into your Roblox account as Robux. You can spend it on ads to promote your game, buy assets from the catalog, or cash it out to real money.

To cash out, you need a Roblox Premium membership (a paid subscription) and a minimum balance of 100,000 Robux. The exchange rate is roughly 1 Robux = 0.0035 USD, though the exact rate changes. You can cash out through the Creator Hub under Earnings. The money goes to your PayPal account or bank account, depending on your region.

If you do not have Premium or do not want to cash out, the Robux stays in your account and you can use it to buy game passes from other developers, purchase cosmetics, or fund your own game's advertising.

Common mistakes and how to avoid them

The most frequent error is using the wrong gamepass ID. Copy it directly from the Creator Hub, not from memory or a screenshot. Paste it into your script exactly as shown, with no extra spaces or characters.

Another mistake is putting your benefit code outside the if hasPass then block. If you do, every player gets the benefit, and the gamepass becomes worthless. Always double-check the indentation in your script — in Lua, indentation shows which code belongs inside the block.

Some developers forget to publish the gamepass in the Creator Hub. If players cannot see it in your game's store, go back to the Creator Hub and confirm the gamepass status is On Sale or Published, not Draft.

Finally, do not test by buying the gamepass with real Robux on your own account. Use the command bar method in Studio, or ask a friend to test on a separate account. Once you buy it, you cannot get a refund, and you have spent money to test your own game.

Frequently Asked Questions

Can I change the gamepass price after I publish it?

Yes. Go to the Creator Hub, find the gamepass, and edit the price. The change takes effect when ready. Players who already own it are not affected — they keep it forever regardless of the current price.

What is the difference between a gamepass and a developer product?

A gamepass is a one-time permanent purchase. A developer product can be bought multiple times and is usually consumable (like in-game currency or a healing potion). Use gamepasses for permanent unlocks and developer products for repeatable purchases.

Do I need to use a specific scripting language?

Roblox games use Lua. The code examples here are Lua. If you use a different language or visual scripting tool, you will need to translate the logic, but the MarketplaceService function names stay the same.

What happens if a player owns the gamepass but leaves and rejoins?

The code checks ownership every time a player joins, so they will get the benefit again. If the benefit is a tool in their backpack, they will receive a fresh copy. If it is a stat multiplier, the code will reapply it. This is the intended behavior.

Can I see how many players bought my gamepass?

Yes. In the Creator Hub, go to your game's Analytics or Monetization section. You will see sales numbers, revenue, and trends over time. This data updates daily.