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 6 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:

01local market = game:GetService("MarketplaceService")
02 
03market.ProcessReceipt = function(Recipt)
04    local PlrId = Recipt.PlayerId
05    local Product = Recipt.ProductId
06    local Plr = game.Players:GetPlayerByUserId(PlrId)
07    --Lol--
08    if Product == 472096369 then
09        local Stats = Plr.leaderstats
10        local Stage = Stats.Stage
11        local new = Stage.Value + 1
12        print(new)
13        Stage.Value = new
14    end
15    wait()
16end

If anyone can help then thank you.

1 answer

Log in to vote
0
Answered by 6 years ago

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

Ad

Answer this question