Why Is It When People Buy Points It Doubles?

This Script Is A Dev Product For 100 Points
First Time you buy it grants the correct amount

Then it randomly does more and more and doubles each time ?
Nothing indicates that ?

Here is the script

game.MarketplaceService.ProcessReceipt = function (recieptInfo)
local plr = game.Players:GetPlayerByUserId(recieptInfo.PlayerId)
if recieptInfo.ProductId == my id here – then
plr.leaderstats.Points.Value = plr.leaderstats.Points.Value + 100
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end)

1 Like
game.MarketplaceService.ProcessReceipt = function (recieptInfo)
	local plr = game.Players:GetPlayerByUserId(recieptInfo.PlayerId)
	if recieptInfo.ProductId == 366760260 then
		plr.leaderstats.Points.Value += 100
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end
1 Like

Problems that I noticed with your original post:

1-the end) at the end should not have the β€˜)’.
2-After you reward the player [meaning he’s bought the product] you need to return PurchaseGranted.
3-To shorten this line :
plr.leaderstats.Points.Value = plr.leaderstats.Points.Value + 100

you can do :

plr.leaderstats.Points.Value += 100

1 Like

https://developer.roblox.com/en-us/api-reference/enum/ProductPurchaseDecision

1 Like

Your A Great Help, Keep On Doing What Your Doing :grinning:

1 Like