So I made a donation leaderboard blah blah blah. But there seems to be a problem with the rewarded currency after purchased via Developer Product.
This is what happens:
(I Sped the video up so it fits with the dev forum size limit.
I’m 100% sure that it is my code.
local mps = game:GetService("MarketplaceService")
local Donation1 = 1156345779
local Donation2 = 1156345978
local Donation3 = 1156345885
local Donation4 = 1156346100
local Donation5 = 1156346173
local Donation6 = 1156346306
local function processReceipt(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if player then
if receiptInfo.ProductId == Donation1 then
player.RobuxInfo.RobuxDonated.Value = player.RobuxInfo.RobuxDonated.Value + 25
elseif receiptInfo.ProductId == Donation2 then
player.RobuxInfo.RobuxDonated.Value = player.RobuxInfo.RobuxDonated.Value + 100
elseif receiptInfo.ProductId == Donation3 then
player.RobuxInfo.RobuxDonated.Value = player.RobuxInfo.RobuxDonated.Value + 500
elseif receiptInfo.ProductId == Donation4 then
player.RobuxInfo.RobuxDonated.Value = player.RobuxInfo.RobuxDonated.Value + 1000
elseif receiptInfo.ProductId == Donation5 then
player.RobuxInfo.RobuxDonated.Value = player.RobuxInfo.RobuxDonated.Value + 5000
elseif receiptInfo.ProductId == Donation6 then
player.RobuxInfo.RobuxDonated.Value = player.RobuxInfo.RobuxDonated.Value + 10000
end
end
end
mps.ProcessReceipt = processReceipt
If you have any idea why It multiplies each purchase. Then please leave it down in the replies. Thanks.