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

What are developer products and how do i make one?

Asked by 10 years ago

What are developer products and how do i make one?

2 answers

Log in to vote
2
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

Along with the Wiki post, here's an example.

h.ClickDetector.MouseClick:connect(function(p) -- I happened to have my event fire from a ClickDetector
        game:GetService("MarketplaceService"):PromptProductPurchase(p, id) -- Make them purchase it.
        -- setup local variables
local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
MarketplaceService.ProcessReceipt = function(receiptInfo) -- Basically, a digital reciept
        if p.userId == receiptInfo.PlayerId then
            if receiptInfo.ProductId == id then
                p.Character.Humanoid.Health = p.Charaacter.Humanoid.Health + 150
        end
    end 

    -- record the transaction in a Data Store
    local playerProductKey = receiptInfo.PlayerId .. "_got_" .. receiptInfo.PurchaseId -- Logs it in Data Store
    ds:IncrementAsync(playerProductKey, 1)  

    -- tell ROBLOX that we have successfully handled the transaction
    return Enum.ProductPurchaseDecision.PurchaseGranted     

    end
end)

Developer products can be purchased multiple times by anyone. Yes, that includes the owner of the game as well. There's many uses for them such as buying an in-game house, buying in-game currency, etc. The possibilities are limitless.

0
Thanks! iluvmaths1123 198 — 10y
0
No problem. Shawnyg 4330 — 10y
Ad
Log in to vote
0
Answered by
TofuBytes 500 Moderation Voter
10 years ago

Here's the link to the wiki to help you get started on Developer Products: Developer Products Wiki Page

It'll explain how you create your own Developer Products and provide some example scripts on how to set-up a shop.

0
Please do not just provide a Wiki link. Provide an explanation Shawnyg 4330 — 10y

Answer this question