Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do I make a Developer product GUI? [closed]

Asked by 10 years ago

Can anyone tell me how to make a GUI that you can buy Developer Products from?

Closed as Too Broad by adark, Spongocardo, and BlueTaslem

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 10 years ago

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().

Ad