Process Receipt Not Working

So I’ve been trying to fix my donation board so it doesn’t give every player in a server a donator badge I made
But for some reason when I test this code it says it failed and redirects me to another donation script I also have for another donation tier
If I disable the script it redirects me to it will skip to another tier of donation until all of them are disabeled and only 1 is enabled (at that point it will work)
Script:

local marketplaceService = game:GetService("MarketplaceService")
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:Connect(function()
	marketplaceService:PromptProductPurchase(plr, 2835750767)
end)

local function processReceipt(receiptInfo)
	local plrBuy = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
	
	if receiptInfo.ProductId == 2835750767 and plrBuy.UserId == plr.UserId then
		game:GetService("BadgeService"):AwardBadge(plr.UserId, 1222750221806277)
		print("Yippee!! Thanksss!!")
		return Enum.ProductPurchaseDecision.PurchaseGranted
	else
		print("Aw man the purchase failed :((((")
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
end

marketplaceService.ProcessReceipt = processReceipt

Redirects me to:

local marketplaceService = game:GetService("MarketplaceService")
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:Connect(function()
	marketplaceService:PromptProductPurchase(plr, 2835752554)
end)

local function processReceipt(receiptInfo)
	local plrBuy = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
	
	if plrBuy.UserId ~= plr.UserId and receiptInfo.ProductId ~= 2835752554 then return Enum.ProductPurchaseDecision.NotProcessedYet end
	
	if receiptInfo.ProductId == 2835752554 then
		game:GetService("BadgeService"):AwardBadge(plr.UserId, 1222750221806277)
		print("Yippee!! Thanksss!!")
		return Enum.ProductPurchaseDecision.PurchaseGranted
	else
		print("Aw man the purchase failed :((((")
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
end

marketplaceService.ProcessReceipt = processReceipt

(Sorry if my English isn’t the best)
Does anyone know how I could fix this?
Fixed versions or code examples will be appreciated!

i think its because theres only 1 matketplaceService.ProcessReceipt function and you are rewriting it twice

you should try to combine both functions into one singular function so this doesnt happen

thats why it works when only 1 script is enabled but doesnt when more are enabled

DO NOT use local script for receipt handler. use only ServerScript for receipt handler
you should also use only one receipt handler
then you can fire different BindableFunction to your other sub handlers

local function processReceipt(receiptInfo)
  if receiptInfo.ProductId == 2835750767 then
    return SubHandler1:Invoke(receiptInfo)
  elseif receiptInfo.ProductId == 2835752554 then
    return SubHandler2:Invoke(receiptInfo)
  end
end
marketplaceService.ProcessReceipt = processReceipt