How To Make Admin Gamepass In Roblox Studio
Creating an admin gamepass is a popular way to give players special powers while also generating revenue for your game. In this tutorial I’ll show you guys the exact steps you need to follow inside Roblox Studio, from setting up the gamepass to scripting the admin features. By the end of the article you’ll have a fully functional admin gamepass that you can sell to other players.
Step 1 – Prepare Your Gamepass on the Roblox Website
Before you touch any code, you must create the gamepass on the Roblox developer portal. Follow these simple actions:
- Log into Roblox.com and go to the Develop page.
- Select your game, then click Create Game Pass.
- Upload an eye‑catching image, give the pass a clear name (e.g., “Admin Pass”), and set a price.
- Copy the numeric ID that appears in the URL – you’ll need this ID in your script.
Once the pass is published, it can be purchased by any player who joins your place.
Step 2 – Add a Purchase Button in Roblox Studio
Now open the place where you want to sell the admin pass. In the Explorer panel create a ScreenGui and add a TextButton. Name the button BuyAdminPass and style it so it stands out on the screen.
In the Properties window set Text to “Buy Admin Pass”. This button will trigger the purchase flow.
Step 3 – Script the Purchase Process
Attach a LocalScript to the button and paste the following code. The script uses the MarketplaceService to prompt the player and then checks whether the purchase succeeded.
In this video I show you the exact snippet you need:
LocalScript code
script.Parent.MouseButton1Click:Connect(function() local MarketplaceService = game:GetService("MarketplaceService") local player = game.Players.LocalPlayer local passId = 12345678 -- replace with your actual gamepass ID -- Prompt the purchase dialog MarketplaceService:PromptGamePassPurchase(player, passId) end)
After the player completes the transaction, you’ll want to grant the admin rights. Create a second script in ServerScriptService to listen for the purchase event.
ServerScript code
local MarketplaceService = game:GetService("MarketplaceService") local PassId = 12345678 -- same ID as above