Can anyone tell me how to make a GUI that you can buy Developer Products from?
COMMUNITY QUESTION
How do I make a Developer product GUI?
1 answer
I do this sort of thing all the time. This script is what I put inside of a GUI button. Here's the code I use:
script.Parent.MouseButton1Click:connect(function()
id = 123456 -- This is a random ID, be sure to replace this with the Developer Product's actual id
service = game:GetService("MarketplaceService")
service:PromptProductPurchase(player, id)
end)
service.ProcessReceipt = function(receiptInfo)
if receiptInfo.ProductId == id then
-- Whatever the developer product does, put that here
end
end
Keep in mind that you need to set the variable "player" before using PromptProductPurchase().
This discussion is preserved as it was. New answers, comments, and votes are closed.
