Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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?

2 comments

0

Return Enum.ProductPurchaseDecision.PurchaseGranted, because the purchase is granted, so after line 5 return Enum.ProductPurchaseDecision.PurchaseGranted

0

thx. answer the question with that so i can accept it.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.