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

Is there a fix for an obby stage script?

Asked by 5 years ago

I'm making a Stage skip script for my friends obby. I've got it working to a point. The first purchase works perfectly, but if its purchased multiple times then it adds an extra stage for every purchase.

I.E. If it was purchased once. Then it gets purchased again. It will add two to the stage instead of just one. Then three for the next purchase.

My currext code is as follows:

local market = game:GetService("MarketplaceService")

market.ProcessReceipt = function(Recipt)
    local PlrId = Recipt.PlayerId
    local Product = Recipt.ProductId
    local Plr = game.Players:GetPlayerByUserId(PlrId)
    --Lol--
    if Product == 472096369 then
        local Stats = Plr.leaderstats
        local Stage = Stats.Stage
        local new = Stage.Value + 1
        print(new)
        Stage.Value = new
    end
    wait()
end

If anyone can help then thank you.

1 answer

Log in to vote
0
Answered by 5 years ago

Nvm this I found the solution. My code was missing the "Enum.ProductPurchaseDecision.PurchaseGranted"

Ad

Answer this question