local ProductToQuantity = {
[3296774010] = 25000,
[3296774101] = 100000,
[3296774225] = 250000,
}
game.Players.PlayerAdded:Connect(function(player)
local Leaderstats = player:WaitForChild("leaderstats")
local function processReceipt(receiptInfo)
local productId = receiptInfo.ProductId
local quantity = ProductToQuantity[productId]
if quantity then
local Leaderstat = Leaderstats:FindFirstChild("Money")
Leaderstat.Value = Leaderstat.Value + quantity
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
game:GetService("MarketplaceService").ProcessReceipt = processReceipt
end)
the prompts are triggered by clicking on a ui button in starter gui locally (already works)