This isn't printing anything or saying any errors, help!

so i’ve recently run into a problem, this script isn’t working at all/ isn’t printing anything without error! normally all marketplace items would print atleast the receipt part, but not even when a single thing in the game is bought it won’t print anything, help!

local MPS = game:GetService("MarketplaceService")

MPS.ProcessReceipt = function(receiptInfo)
	print("step 1")
	if receiptInfo.ProductId == 1205859299 then
		print("step 2")
		local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
		print("step 3 is about the player which is "..(player))
		player.Chance.Value += 36
		print("final step complete")
		return Enum.ProductPurchaseDecision.PurchaseGranted

normally i’m able to find out what happened but i’ve never run into this problem before, so thanks for reading and if you can, please help!

try something like this

local MarketplaceService = game:GetService("MarketplaceService")

local Products = {
	[0]=function(receipt,player) -- the 0 is id of product
		player.leaderstats.Gems.Value +=  5 -- this is what it does when product is bought


function MarketplaceService.ProcessReceipt(receiptinfo)
	local playerProductKey = receiptinfo.PlayerId..":"..receiptinfo.PurchaseId
	local plr = game:GetService("Players"):GetPlayerByUserId(receiptinfo.PlayerId)
	local handler
	for ProductId,func in pairs(Products) do
		if ProductId == receiptinfo.ProductId then
			handler = func break
local suc = pcall(handler,receiptinfo,plr)
return Enum.ProductPurchaseDecision.PurchaseGranted
1 Like

The script is a descendant of a service where it can run right? Also, you’re not rebinding the process reciept function more than once?

1 Like

it still doesn’t do anything, at all, no errors, nothing.

it’s a descendant of serverscriptservice, and what do you mean rebinding?

Ok so you are prompting the player to buy a Developer Product right?
That callback will only run if a player actually asks Roblox to buy something (you wont be charged if it’s in Studio)

yes it is prompting the player to buy a dev product

local MPS = game:GetService("MarketplaceService")
local players = game:GetService("Players")

function processReceipt(receiptInfo)
	if receiptInfo.ProductId == 1205859299 then
		local player = players:GetPlayerByUserId(receiptInfo.PlayerId)
		if player then
			player:WaitForChild("Chance").Value += 36
			return Enum.ProductPurchaseDecision.PurchaseGranted
			return Enum.ProductPurchaseDecision.NotProcessedYet

MPS.ProcessReceipt = processReceipt

Make sure the developer product ID is correct & that the script is a server script in the correct location.

weird because works perfect for me

Pretty sure he is rebinding as there doesn’t seem to be any issue with his code. If even the “step 1” print isn’t being ran then something else is happening before the function.

well there is a donation board in this game, would that be causing a problem?

only one can exist per game
that one must handle all dev products


found out the donation board isn’t causing any problems, but is there any easy way i could find if this was in one of the scripts? the reason i don’t know about where the script is is because i got hired after another scripter who was very messy and didn’t really sort anything, i disabled and noted his original devproduct handler but that didn’t do anything

Ctrl + Shift + F > “ProcessReceipt”

The donation board would be causing the issue by the way, it’s a first bind first serve situation with ProcessReceipt.

1 Like

thank you so much!

30 letters because bruh