local MarketplaceService = game:GetService('MarketplaceService')
local devproductid = 53552490

MarketplaceService.ProcessReceipt = function(receiptInfo)
	for i, player in ipairs(game.Players:GetChildren()) do
		if player.userId == receiptInfo.PlayerId then
			if receiptInfo.productId == devproductid then
				
			player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 2
			
		end
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

2 comments

0

Try UserId instead of userId

0

You're missing an end. By the way, use a code block (that little lua button on the editor https://forum.scriptinghelpers.org/topic/82/) when you're creating your questions.