Is there a fix for an obby stage script?
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:
01 | local market = game:GetService( "MarketplaceService" ) |
03 | market.ProcessReceipt = function (Recipt) |
04 | local PlrId = Recipt.PlayerId |
05 | local Product = Recipt.ProductId |
06 | local Plr = game.Players:GetPlayerByUserId(PlrId) |
08 | if Product = = 472096369 then |
09 | local Stats = Plr.leaderstats |
10 | local Stage = Stats.Stage |
11 | local new = Stage.Value + 1 |
If anyone can help then thank you.