I have an obby, and there is a skip stage button. There is a skip 10 stages, and skip 1. The skip 1 works fine, but skip 10 is broken. Here is the local script in it:
local productId = 53038472
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)
Here is the other script that isnt local:
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 == 53038472 and done == 0 then
done = 1
players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + 10
players[i].Character.Humanoid.Health = 0
done = 0
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
these seem so perfect, whats wrong?

1 comment
You see where it says "players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + 10"? Thats what the stage is supposed to go up buy when the dev product is bought