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

How to Developer Products?

Asked by 10 years ago

How could this be more efficient, sometimes it does not give them cash.

local Products={
    ["0"]=100, --Hidden
    ["0"]=200, --Hidden
    ["0"]=300, --Hidden
    ["0"]=400, --Hidden
    ["0"]=500, --Hidden
}

Game:GetService("MarketplaceService").ProcessReceipt=function(Receipt)
    local PlayerProductKey = Receipt.PlayerId.."_"..Receipt.PurchaseId
    for _,Player in ipairs(Game.Players:GetChildren())do
            for i, v in pairs(Products)do
                if tostring(Receipt.ProductId)==i then
                    repeat wait(2) until Player:FindFirstChild("leaderstats")
                    Player:FindFirstChild("leaderstats").CashPLAYER.Value = Player:FindFirstChild("leaderstats").CashPLAYER.Value + v
                    Game:GetService("DataStoreService"):GetDataStore("PurchaseHistory"):IncrementAsync(PlayerProductKey, 1)
                    return Enum.ProductPurchaseDecision.PurchaseGranted
                end
        end
end
end

1 answer

Log in to vote
-1
Answered by
trogyssy 221 Moderation Voter
10 years ago

Look here https://scriptinghelpers.org/blog/developer-products-in-app-purchases-in-roblox

0
For real...i know how to do this, i'm asking for help... peoplemove12 148 — 10y
Ad

Answer this question