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

Problem with Developer Product?

Asked by 8 years ago

Wow, thanks for all the help Scripting Helpers.

local buyButton = script.Parent
local productId = 25039259

buyButton.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
end)


local MarketplaceService = game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = 20518668

MarketplaceService.ProcessReceipt = function(receiptInfo) 

    for i, player in ipairs(game.Players:GetChildren()) do
        if player.userId == receiptInfo.PlayerId then


            if receiptInfo.ProductId == productId then
                player.leaderstats.Money.Value = player.leaderstats.Money.Value + 100
            end
        end
    end 

    local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.ProductId
    ds:IncrementAsync(playerProductKey, 1)  

    return Enum.ProductPurchaseDecision.PurchaseGranted     
end
0
Can you fill us in on what exactly your problem is? That might help us solve it dyler3 1510 — 8y
0
Simple, nothing happens, user is not prompted to buy the product. PancakeChop 35 — 8y

Answer this question