As the title suggest, I want to achieve a Skip Stage Script, but the script I have made is totally not working, would love some help thank you.
MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo)
local players = game.Players:GetPlayers()
local currency = "Stage"
local done = 0
for i=1,#players do
if players[i].userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == 959773024 and done == 0 then --That Number is the devProduct ID
done = 1
players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + 1
players[i].Character.Humanoid.Health = 0
done = 0
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end```
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local StageProductId = 959773024
MarketplaceService.ProcessReceipt = function(receiptInfo)
local PlayerId = receiptInfo.PlayerId
local Player = Players:GetPlayerByUserId(PlayerId)
local ProductId = receiptInfo.ProductId
local StatFolder = Player:FindFirstChild("leaderstats")
local StageValue = StatFolder and StatFolder:FindFirstChild("Stage")
if StageValue then
if ProductId == StageProductId then
StageValue.Value = StageValue.Value + 1
Player:LoadCharacter()
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
return Enum.ProductPurchaseDecision.NotProcessedYet
end
But there is one problem, tested it just now it worked, and I made no edits no nothing and the next time I tested, it didn’t work. Is this a Roblox Issue?