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

ProcessReceipt repeats when purchasing a dev product, know a fix?

Asked by 4 years ago
Edited 4 years ago

I tried adding 100 to the value of a player's healthValue (an IntValue) when they purchased a developer product. Here's the script:

local market = game:GetService("MarketplaceService")
market.ProcessReceipt = function(receiptInfo) 
    if receiptInfo.ProductId == 566972951 then 
        local plr = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
        plr.healthValue.Value = plr.healthValue.Value + 100
    end
end

Whenever a player buys the product, they gain 100. However, buying the product again results in adding 200 more to the value instead of 100. How does this work and how can I fix this?

0
Return Enum.ProductPurchaseDecision.PurchaseGranted, because the purchase is granted, so after line 5 `return Enum.ProductPurchaseDecision.PurchaseGranted` User#24403 69 — 4y
0
thx. answer the question with that so i can accept it. User#28017 0 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

give me my rep

0
3 hours late lol User#28017 0 — 4y
Ad

Answer this question