local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local ProductToQuantity = {
[3296774010] = 25000,
[3296774101] = 100000,
[3296774225] = 250000,
}
MarketplaceService.ProcessReceipt = function(receiptInfo)
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local leaderstats = player:FindFirstChild("leaderstats")
if not leaderstats then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local money = leaderstats:FindFirstChild("Money")
if not money then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local quantity = ProductToQuantity[receiptInfo.ProductId]
if quantity then
money.Value = money.Value + quantity
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
the prompting is handled on the client with a ui button (already working)
** You are now Level 3! **