Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Change in price for Skip Stage gui dev product?

Asked by 4 years ago

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

1 answer

Log in to vote
0
Answered by
kom297 -4
4 years ago
Edited by Ziffixture 4 years ago

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
0
You made a small syntax error Ziffixture 6913 — 4y
0
What would that be? i just copied how his current if statement was structured kom297 -4 — 4y
Ad

Answer this question