I used a product script to sell products. It is supposed to give +1 of a stat every buy. It works, but it gives +1, then +2, then +4, then +8, and so on. Why does it do that?
Here is the script.
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo)
local PlayerBoughtID = receiptInfo.PlayerId
local PlayerBought
for iPlayers, vPlayer in pairs(game.Players:GetChildren()) do
if vPlayer.userId == PlayerBoughtID then
PlayerBought = vPlayer
end
end
if receiptInfo.ProductId == 12345678 then -- ID HERE
PlayerBought.leaderstats.Money.Value = PlayerBought.leaderstats.Money.Value + 1
end
end

3 comments
Because you're generous!
Is this a DevProduct purchase?
^ I would say it's safe to assume this, since it is seemingly bought multiple times. This appears to be a very dumbed down version of a money purchasing script.