When i purchase a devproduct it only works in a local server, not ingame nor in a team test. I understand it has something to do with multiple receipts but either way it still doesnt work when I attempted to fix it.
local MPS = game:GetService("MarketplaceService")
local productToMoneyMap = {
[1585512192] = 6000,
[1585533725] = 30000,
[1585534350] = 115000,
[1585535045] = 280000,
[1585535384] = 1000000,
}
MPS.ProcessReceipt = function(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
if player then
print("Player found:", player.Name)
local productId = receiptInfo.ProductId
local moneyToAdd = productToMoneyMap[productId]
if moneyToAdd then
print("Processing receipt for ProductId:", productId)
player.leaderstats.money.Value += moneyToAdd
print("Money after update:", player.leaderstats.money.Value)
return Enum.ProductPurchaseDecision.PurchaseGranted
else
print("Unknown product ID:", productId)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
print("Player not found.")
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end
if you got any suggestion for a fix that will be much appreciated