I’m trying to make it so that when you buy a dev product it adds one to the Stage leaderboard.
local MarketplaceService = game:GetService("MarketplaceService") function processReceipt(receiptInfo) local player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId) if not player then return Enum.ProductPurchaseDecision.NotProcessedYet end -- script below controls what happens if bought player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1 return Enum.ProductPurchaseDecision.PurchaseGranted end MarketplaceService.ProcessReceipt = processReceipt
It does sort of what I asked. However, when you buy it twice it goes up by 2 and when you buy a third time it goes up by 3, and so on. How do I make it so it only adds 1 every time?