local mS = game:GetService("MarketplaceService") local players = game:GetService("Players") local productFunctions = {} productFunctions[3601082708] = function(receipt, player) player.leaderstats.Diamonds.Value += 100000 end local function processReceipt(receiptInfo) local userId = receiptInfo.PlayerId local productId = receiptInfo.ProductId local player = players:GetPlayerByUserId(userId) if player then local handler = productFunctions[productId] local success, result = pcall(handler, receiptInfo, player) if success then return Enum.ProductPurchaseDecision.PurchaseGranted else warn("Failed to process recipt", receiptInfo, result) end end return Enum.ProductPurchaseDecision.NotProcessedYet end mS.ProcessReceipt = processReceipt