local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local productFunctions = {} productFunctions[3590811150] = 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", receiptInfo, result) end end return Enum.ProductPurchaseDecision.NotProcessedYet end MarketplaceService.ProcessReceipt = processReceipt local mS = game:GetService("MarketplaceService") local shopEvent = game.ReplicatedStorage.Remotes.Shop local devID = script.ID.Value local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() mS:PromptProductPurchase(player, devID) end)