I need help with my coin devloper product scripts

Okay, so I want this script to be able to give the player a certain amount of coins when they buy it.

Okay, so the FIRST script where it gives 100 COINS everytime you buy it works, but…the second script where it gives 450 COINS doesn’t. Instead it’ll give 100 coins still.

I hadn’t found one thing to fix my situation.

-- SECOND SCRIPT FOR 450 COINS
local function processReceipt(receiptInfo)
	
	
	local player1 = players:GetPlayerByUserId(receiptInfo.PlayerId)
	if not player1 then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	
	  if player1 then
		coins.Value = coins.Value + 450
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
	

	
end



MarketPlaceService.ProcessReceipt = processReceipt

– FIRST SCRIPT FOR 100 COINS
local function processReceipt(receiptInfo)

local player1 = players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player1 then
	return Enum.ProductPurchaseDecision.NotProcessedYet
end

  if player1 then
	coins.Value = coins.Value + 100
end
return Enum.ProductPurchaseDecision.PurchaseGranted

end

MarketPlaceService.ProcessReceipt = processReceipt

You should first check for the ProductID, what product the player bought.

Adding onto what @Vaschex said, you should make sure you are using different ProductId’s for both scripts

Yeah, they are both different product IDs and that isn’t gonna fix the problem. I have no clue what I did wrong.

Your not handling the process receipt callback properly, more info here : MarketplaceService | Documentation - Roblox Creator Hub

1 Like