How to prompt dev product purchase

  1. So, I’m trying to make it so when you click a UI button you’ll get prompted to buy a dev product.

  2. Whenever I try to click on the button, it prompts me to purchase but then says something went wrong try again later.

  3. Well, the roblox dev hub script didn’t work so I just used the script I had used for gamepasses and tried it out.

This is my script:
script.Parent.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer,1158617163) end)
I just need to know, can you use scripts that were made for gamepasses? Would I have to make a new script? Any help is appreciated. Thanks!

2 Likes

Check if HTTP Requests are turned on, or API Services in the Game Settings

They seem to be. Still gives me a error.

Because PromptGamePassPurchase is exclusively for prompting gamepass purchases (as the name suggests lol), use PromptProductPurchase. This will prompt developer products.

local Player = game:GetService('Players').LocalPlayer
local MarketplaceService = game:GetService('MarketplaceService')

script.Parent.MouseButton1Click:Connect(function()
    MarketplaceService:PromptProductPurchase(Player,1158617163)
end)
6 Likes

Thanks so much! I don’t have much experience in the marketplace field. Works perfectly now. Also im half blind when looking at scripts lol.

If you want to learn more, simply take a look at the documentation provided by Roblox on the developer hub:

1 Like