I’m on a loss as to how you call the function on process receipt and I want to know what does the first argument of Process Receipt (in a function) represent and the second?
MarketPlaceService.ProcessReceipt = productHandler
Why can’t you just call the function by it’s name? Someone please explain.
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local Ids = {
[1034505260] = 50,
[1034505524] = 110,
[1034505858] = 250,
[1034506135] = 600,
[1034506492] = 1500,
}
local function productHandler(productInfo)
local Player = Players:GetPlayerByUserId(productInfo.PlayerId)
if not Player then return Enum.ProductPurchaseDecision.NotProcessedYet
end
Player.leaderstats.Points.Value += Ids[productInfo.ProductId]
return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketPlaceService.ProcessReceipt = productHandler