Ad
Log in to vote
1

Obby skip stage not working?

Asked by 11 days ago
Edited 11 days ago

Ok,so I finded a script on youtube and I get a error here is the script and the error:

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 == 1169323090 and done == 0 then
            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

ERROR: Workspace.Script:10: Expected 'do' when parsing for loop, got Unicode character U+200b - Studio - Script:10

3 answers

Log in to vote
0
Answered by 11 days ago
Edited 11 days ago

i would use productfinished

game:GetService'MarketplaceService'.PromptProductPurchaseFinished:Connect(function(userId, productId, didBuy)

-- userId is the players userid (player.UserId)
-- productId is the id of product
-- didBuy is if they bought, canceled, or error (true or false)

    if didBuy and productId == 1169323090 then -- think its didBuy. could be if not didBuy
        local player = game.Players:GetPlayerByUserId(userId) -- get player. you have userid  (do somethin like this)
        player.leaderstats.Stage.Value += 1
    end
end)
0
Testing alexandruboc22 12 — 11d
0
uh dos it work BulletproofVast 385 — 11d
Ad
Log in to vote
0
Answered by 11 days ago

I haven't tested this but try this instead

currency = "Stage"

done = 0

for i,v in pairs(game.Players:GetChildren()) do
    if v.UserId == receiptInfo.PlayerId then
        if receiptInfo.ProductId == 1169323090 and done == 0 then
            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 

Also sorry if I misunderstood that but I think this should work.

0
It is not working can you try remake? alexandruboc22 12 — 11d
Log in to vote
0
Answered by 11 days ago

I haven't tested this but try this instead

currency = "Stage"

done = 0

for i,v in pairs(game.Players:GetChildren()) do
    if v.UserId == receiptInfo.PlayerId then
        if receiptInfo.ProductId == 1169323090 and done == 0 then
            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 

Also sorry if I misunderstood that but I think this should work.

0
Not working. alexandruboc22 12 — 11d

Answer this question