Hello. I'm currently trying to achieve a script that changes price depending on the stage someone is currently on. For example, is someone is on stage 1 and they click the skip stage gui, it goes to a dev product that costs 10 robux. However, if the user is on stage 5, it goes to a different dev product for 25.
My script:
MarketplaceService = Game:GetService("MarketplaceService") MarketplaceService.ProcessReceipt = function(receiptInfo) players = game.Players:GetPlayers() currency = "Stage" done = 0 for i=1,#players do if players[i].userId == receiptInfo.PlayerId then if receiptInfo.ProductId == 22277159 and done == 0 then done = 1 players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + 1 players[i].Character.Humanoid.Health = 0 done = 0 end end end return Enum.ProductPurchaseDecision.PurchaseGranted end
Just add an if statement to check what their stage is like
if players[i].leaderstats[currency].Value = 5 then --put whatever dev product thing here end