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!
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
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.