Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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:

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.