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

01local MarketplaceService = game:GetService('MarketplaceService')
02 
03local function processReceipt(receiptInfo)
04    local player = game:GetService('Players'):GetPlayerByUserId(receiptInfo.PlayerId)
05    if not player then
06        --Player doesn't exist / left game.
07        return Enum.ProductPurchaseDecision.NotProcessedYet
08    end
09    --Script below controls what happens if bought.
10    print(player.Name .. ' just bought ' .. receiptInfo.ProductId)
11    player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1
12    player.Character:MoveTo(Vector3.new(player.leaderstats.Stage.Value))
13    return Enum.ProductPurchaseDecision.PurchaseGranted
14end
15 
16MarketplaceService.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