Developer Products – In‑Game Purchases

Time:10 分钟

Developer products are items which players can buy more than once, making them perfect for in-game currency, ammo, or similar purchases.

For items or abilities that a player might purchase just once, such as a special weapon or a permanent power-up, please refer to Articles/Game Passes One Time Purchases|Game Passes.

Creating a Developer Product

To create a new developer product:

  1. In Roblox Studio, click on the Game Settings button from the Home tab. https://developer.roblox.com/assets/bltd6af44e38b951d0a/Game-Settings.png

  2. Select the Monetization tab.

  3. Next to Developer Products, click the Create button. https://developer.roblox.com/assets/blt0a372e91f5852e99/Developer-Product-Create.png

  4. For the new placeholder product, click the https://developer.roblox.com/assets/blt173a1a863c7190a4/PlayFab-Dots-Icon.png

button and select Edit. https://developer.roblox.com/assets/bltae98cda6a17b56b1/Developer-Product-Edit.png

  1. Specify the product’s name and the price.

  2. Click the Save button.

After creating a developer product, Roblox assigns it a unique ID and all products are neatly listed in the Monetization tab.

https://developer.roblox.com/assets/blt77098ed66bd4f813/Dev-Product-Listing.png

Scripting for Developer Products

To take full advantage of developer products, you’ll need to use scripting. Here are some common examples:

Getting a Game’s Developer Products

To gather data for all of the developer products in a game, use the MarketplaceService/GetDeveloperProductsAsync|GetDeveloperProductsAsync() method. This returns a Pages object that you can inspect and filter to build an in-game store, product list GUI, etc.

Getting Product Info

To get information (price, name, image, etc.) for a specific product, use the MarketplaceService/GetProductInfo|GetProductInfo() function with a second argument:

Roblox官方链接:Developer Products – In‑Game Purchases