the script will award but it won't award the correct amount after the first time you buy the same Developer Product. It's like if you buy it and it will award you 2 points, and you keep buying it it will look like this.. First - 2 Second - 4 Third - 6 Fourth - 8 And so on. it keeps going up like that. I don't know why it keeps happening. I believe it has to do with 'pointsToAward' But I don't see how it keeps doing this.
Edit: It should only be awarding 2 each time they buy it, not how it is above.
local function buyItem(button)
button.MouseButton1Click:connect(function()
local marketId = button["market"].Value
local pointsToAward = button["points"].Value
link:PromptProductPurchase(plr,marketId)
link.ProcessReceipt = function(receiptInfo)
if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then
stat.Value = stat.Value + pointsToAward
end
end
end)
end

2 comments
stat.Value is their leaderstats.. If I changed that to 0, they would be mad. What the script keeps doing is keep rewarding them over and over again, I would need a way to delete the receiptInfo after it gave them the Currency...
Then turn the info to a var then reset it each time.