Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Trying to script skip stage, it teleports me but not to the stage, what am I doing wrong?

Asked by 5 years ago

I've tried multiple things but still can't get it to work, here's the code

local MarketplaceService = game:GetService('MarketplaceService')

local function processReceipt(receiptInfo)
    local player = game:GetService('Players'):GetPlayerByUserId(receiptInfo.PlayerId)
    if not player then
        --Player doesn't exist / left game.
        return Enum.ProductPurchaseDecision.NotProcessedYet
    end
    --Script below controls what happens if bought.
    print(player.Name .. ' just bought ' .. receiptInfo.ProductId)
    player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1
    player.Character:MoveTo(Vector3.new(player.leaderstats.Stage.Value))
    return Enum.ProductPurchaseDecision.PurchaseGranted
end

MarketplaceService.ProcessReceipt = processReceipt

Thanks, for your service.

0
It would be helpful if you said what these 'multiple things' were. If it's teleporting you but not to the correct location, maybe you haven't defined the where stage.value + 1 is ittyisaduck 21 — 5y
0
Well, that is in another script in 'ServerScriptService'. Not local. jordysboy 53 — 5y

Answer this question