Allowing users to purchase developer products

Hello, I am making a game in which you can buy in-game currency. How can I make it that when you tap on the buttons to buy, it presents you with a developer product. You can either send tutorials, or give me step-to-step directions. Any help is appreciated. Have a good day!

1 Like

When you open a shop there are buttons. When you press one you can buy “bobux”.

Ok,so uh, how would I go about doing this?

I Dont know… Im a game creator bur not get into guis

https://developer.roblox.com/en-us/articles/Developer-Products-In-Game-Purchases#:~:text=Code%20Light%20Theme-,Prompting%20a%20Purchase,whatever%20fits%20your%20game%20design.

Hi there @ElectorWittelsbach,

You can find the necessary information on https://developer.roblox.com/en-us/articles/Developer-Products-In-Game-Purchases

If you need any more information, feel free to send me a DM / reply in this forum thread.

@raulgamer43 can you not respond to a post when you dont know the answer to the query ? This really only creates a lot of confusion for OP. Thanks !

Alright! Thank you for the help.

You will need MarketplaceService, specifically the function PromptProductPurchase.

When the player clicks the button you will want to prompt the product purchase.

Example:

local players = game:GetService("Players")
local marketplaceService = game:GetService("MarketplaceService")

local localPlayer = players.LocalPlayer

local productId = 000000
local button = script.Parent

button.MouseButton1Click:Connect(function()
	marketplaceService:PromptProductPurchase(localPlayer, productId)
end)

Would I put the script in server script service, or inside of the ui?

You would put it inside the LocalScript that handles your GUIs.

How can I continue on to this, and make the player get like 10 “bobux” (in-game currency)?

You will need to use ProcessReceipt. The documentation in the link I provided has a pretty good example and explains how to use it pretty well.