MarketPlaceService not working

I am making a product purchase in my game, but it is not doing anything. I had the same script in one of my previous games and that one worked, but when I moved it to my new game it didn’t work.

script
local MPS = game:GetService("MarketplaceService")
local ProductID = 1232153358
local Players = game:GetService("Players")
local function Receipt(ReceiptInfo)
	local BoughtProductId = ReceiptInfo.ProductId
	local Purchaser = Players:GetPlayerByUserId(ReceiptInfo.PlayerId)
	if not Purchaser then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	local player=  Purchaser
	if Purchaser and  BoughtProductId == ProductID then
		player.backpack.Value=  game.ReplicatedStorage._backpack.MoonBack  
		
		local read =  CFrame.new(player.Character.UpperTorso.CFrame.Position)
		player.Character.Humanoid:TakeDamage(999)
		wait(0.50)
		player.Character.UpperTorso.CFrame =  read
		
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end
MPS.ProcessReceipt = Receipt

Any help is greatly appreciated!!!
Have a happy new year! :slight_smile:

1 Like

Did you check if the ProductID exists in the game?

1 Like

Yes it does. I just created it

Are you trying to buy a developer product?

Any errors appearing in the output?

Can’t see anything wrong with it, Are you testing it in studio? if so make sure you have api services enabled

You may have another script trying to process a devproduct reciept. Only one script can recieve the reciept at one time so you should probably check that

1 Like