Is this developer product script right?

Basically the product gets prompted and there is no issue with that and it’s the right id.
Then the potions arn’t given to the player and the print statement doesn’t get output as well.
Can anyone find a problem?

local MPS = game:GetService("MarketplaceService")
 
MPS.ProcessReceipt = function(receiptInfo)

------------------------------------------------------------------------------------------ 
-- potions	
    if receiptInfo.ProductId == 1041244494 then 
        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
        print("Working?")
        player.leaderstats.Potions.Value = player.leaderstats.Potions.Value + 100
        return Enum.ProductPurchaseDecision.PurchaseGranted
       
    elseif receiptInfo.ProductId == 1041244790 then 
        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
         player.leaderstats.Potions.Value =  player.leaderstats.Potions.Value + 250
        return Enum.ProductPurchaseDecision.PurchaseGranted
    	
	elseif receiptInfo.ProductId == 1041245082 then 
        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
         player.leaderstats.Potions.Value =  player.leaderstats.Potions.Value + 750
        return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

I’m not a good scripter.
But read this API Reference about Developer Products it may be helpful.

1 Like

Yes, it is a developer product script.

Yes I know that, is was seeing if anyone knew the problem