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

how do I fix my obby's skip stage script?

Asked by 4 years ago

hello I am making an obby and I made a skip stage script. it wont work tho. how do I fix it?

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

Answer this question