proid = 1847030516
badgeid = 4057989400365340
mps.ProcessReceipt = function(recipt)
if recipt.ProductId == proid then
if game.Players:FindFirstChild(game.Players:GetNameFromUserIdAsync(recipt.PlayerId)) then
local plr = game.Players:GetPlayerByUserId(recipt.PlayerId)
game:GetService("BadgeService"):AwardBadge(plr.UserId,badgeid)
return Enum.ProductPurchaseDecision.PurchaseGranted
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end```
#dev product badge giver doesnt works
107 messages · Page 1 of 1 (latest)
what script did you make that in, server or local?
im thinking its either because of wrong proid/badgeid or the script is local
since the script should be working
its normal script i guess server?
not local
where is the script parented to
serverscriptservice
could you show the output after purchasing the dev prod
what exactly isnt working btw?
its not awarding a badge?
its working on my end, only problem could be that you already own the badge since theres no error
maybe you forgot the promptProductPurchase like this?
its not awarding the badge
nah i checked iti alr
no i have it
on npc
proximity prompt
and it works
badge is not in your inventory?
it also depends on who created the badge
nah im sending ss
** You are now Level 7! **
if you're working on a group owned game, youd have to change the badge creatorship to the group instead of your own acc
i created badge on group
local mps = game:GetService("MarketplaceService")
proid = 1847030516
badgeid = 4057989400365340
mps.ProcessReceipt = function(recipt)
if recipt.ProductId == proid then
if game.Players:FindFirstChild(game.Players:GetNameFromUserIdAsync(recipt.PlayerId)) then
local plr = game.Players:GetPlayerByUserId(recipt.PlayerId)
game:GetService("BadgeService"):AwardBadge(plr.UserId,badgeid)
return Enum.ProductPurchaseDecision.PurchaseGranted
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end```
doesnt gives badge
slm, turkmusun?
mhm lets see
it doesnt gives
I js came back from helping others lmao
the badge
lemme see
lol
local mps = game:GetService("MarketplaceService")
proid = 1847030516
badgeid = 4057989400365340
mps.ProcessReceipt = function(recipt)
if recipt.ProductId == proid then
if game.Players:FindFirstChild(game.Players:GetNameFromUserIdAsync(recipt.PlayerId)) then
local plr = game.Players:GetPlayerByUserId(recipt.PlayerId)
game:GetService("BadgeService"):AwardBadge(plr.UserId,badgeid)
return Enum.ProductPurchaseDecision.PurchaseGranted
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end```
this is your code, right?
Yes
local mps = game:GetService("MarketplaceService")
local BadgeService = game:GetService("BadgeService")
local proid = 1847030516
local badgeid = 4057989400365340
mps.ProcessReceipt = function(receipt)
if receipt.ProductId == proid then
local player = game.Players:GetPlayerByUserId(receipt.PlayerId)
if player then
BadgeService:AwardBadge(player.UserId, badgeid)
return Enum.ProductPurchaseDecision.PurchaseGranted
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end```
try this
@wary dagger
I meant to reply to @tidal linden btw, lol
soooo did it work?
hm
bro whats your description btw
whats wrong with it
why are you disrespecting Islam like dat?
alr, anyway did the code work?
no
checking rn
yeah for some reason it runs perfectly except for the awardBadge method
I had that issue once when I was a beginner
I spent an hour on it
it turned out that the id was incorrect
mhm
thing is he pasted the correct id
yah
did this code accumulate any errors?
no
mhm lets try debugging then
man who even uses processReceipt anyways use promptProductPurchased instead lol
jk
transactions are apparently important yea
actually true lol
I never use processReceipt
local MarketplaceService = game:GetService("MarketplaceService")
local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")
local productId = 1847030516
local badgeId = 4057989400365340
MarketplaceService.ProcessReceipt = function(receipt)
print("Processing receipt:", receipt)
if receipt.ProductId == productId then
local player = Players:GetPlayerByUserId(receipt.PlayerId)
if player then
local success, err = pcall(function()
BadgeService:AwardBadge(player.UserId, badgeId)
end)
if success then
print("Awarded badge to player:", player.Name)
return Enum.ProductPurchaseDecision.PurchaseGranted
else
warn("Failed to award badge:", err)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
warn("Player not found:", receipt.PlayerId)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
warn("Unexpected ProductId:", receipt.ProductId)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end
try this
@tidal linden atm im working on a commission, making a party system basically. I spent 10 mins just thinking abt why the code doesnt work, suddenly I remembered that I was using the same remote event for 2 different things, which is why it would duplicate 😝
bro it doesnt gives any output
i think it can't see productpurchase
there is a one more processreceipt script alsso
like it can be broken by it?
its same product id
it just animates npc
on different script
oof
is this the issue
lol
okay i fixed it
thank you guys
i hope you dont cry later because of 17 mins waste of time
the thing i am trying to say is
this wasn't because of me
thats all