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!