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

How do I add a limit for skipping? [closed]

Asked by 6 years ago

This question already has an answer here:

How do I add a limit for skipping stages?

How to add a limit for player skipping stage,like I have 5 stages and they can only skip until stage 5

local MPS = game:GetService("MarketplaceService")
MPS.ProcessReceipt = function(receiptInfo)
local x = game.Players:GetChildren()
local done = false

for i=1,#x do
    if x[i].userId == receiptInfo.PlayerId then
        if receiptInfo.ProductId == 0 then
            if done == false then
                done = true
                x[i].leaderstats.Stage.Value = x[i].leaderstats.Stage.Value + 1
                x[i]:LoadCharacter()
                done = false
            end
        end
    end
end

return Enum.ProductPurchaseDecision.PurchaseGranted 

end

Marked as Duplicate by RubenKan

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?