How To Make a Gamepass in Roblox PC
Creating a gamepass gives your Roblox game a new revenue stream and lets players unlock exclusive features. In this tutorial I show you how to set up a gamepass from start to finish, using the Roblox Studio interface and the DevHub tools.
1. Prepare Your Game for Monetization
Before you add a gamepass, make sure your game meets Roblox’s monetization guidelines:
- Age-appropriate content – no adult themes or copyrighted music.
- Clear value proposition – the gamepass should offer a tangible benefit.
- Roblox Studio version – keep it updated to access the latest DevHub features.
Learn how to review the guidelines on the Roblox website, and double‑check that your game is ready for players to purchase.
2. Create the Gamepass in the Roblox Developer Hub
Open your web browser, log into the Roblox account that owns the game, and go to the DevHub page. Follow these steps:
- Navigate to Develop → Gamepasses under the selected game.
- Click New Gamepass.
- Fill in the required fields:
- Name – a concise title.
- Price – set a price in Robux.
- Icon – upload a 512×512 PNG.
- Description – explain the benefit clearly.
- Click Save and note the Gamepass ID that appears.
This updated guide shows you that the ID is crucial for scripting the purchase logic inside Roblox Studio.
3. Script the Gamepass Functionality in Roblox Studio
Open your game in Roblox Studio and add a Script to the part of the game where the player will acquire the pass. Use the following template, replacing YOUR_GAMEPASS_ID with the numeric ID you copied earlier:
local MarketplaceService = game:GetService("MarketplaceService")
local gamepassId = YOUR_GAMEPASS_ID
local function onPurchaseRequested(player)
local success, errorMessage = pcall(function()
MarketplaceService:PromptGamePassPurchase(player, gamepassId)
end)
if not success then
warn("Purchase failed: "..errorMessage)
end
end
-- Example trigger: a button click
local button = script.Parent
button.MouseButton1Click:Connect(function()