Advertisement
drakon-firestone

Untitled

Nov 24th, 2024
55
0
21 hours
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. local function processReceipt(receiptInfo)
  2.     local userId = receiptInfo.PlayerId
  3.     local productId = receiptInfo.ProductId
  4.     local player = Players:GetPlayerByUserId(userId)
  5.     if player then
  6.         local handler = productFunctions[productId]
  7.         local success, result = pcall(handler, receiptInfo, player)
  8.         if success then
  9.             return Enum.ProductPurchaseDecision.PurchaseGranted
  10.         else
  11.             warn("Failed to process receipt:", receiptInfo, result)
  12.         end
  13.     end
  14.     return Enum.ProductPurchaseDecision.NotProcessedYet
  15. end
  16. MarketplaceService.ProcessReceipt = processReceipt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement