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

How to instantly skip 50 stages but use it only one time?

Asked by 4 years ago
Edited 4 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

Let's Say I am in stage 14 I want to be in stage 50 but how could I do it so that the player goes to it but doesn't be able to purchased again

MarketplaceService = Game:GetService("MarketplaceService")

MarketplaceService.ProcessReceipt = function(receiptInfo)
players = game.Players:GetPlayers()

local currency = "Stage"

done = 0

for i=1,#players do
    if players[i].userId == receiptInfo.PlayerId then
        if receiptInfo.ProductId == 967779711 and done == 0 then
            done = 1
            players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + 50
            players[i].Character.Humanoid.Health = 0
                done = 0

        end
    end
end
return Enum.ProductPurchaseDecision.PurchaseGranted 
end``
local amount
local stagesskipped
local stages = 112 -- the amount of stages the player is at stages
for i = 1,50 do-- 50 is the max amount of times the for statement will have to run
    local number = stages+i
    local end2 = string.sub(number,string.len(number)-1,string.len(number))--this gets the last two numbers of the stage
    if tonumber(end2) == 00 or tonumber(end2) == 50 or tonumber(number) == 0 then amount = number stagesskipped = i end-- if the number ends in 00 50 or the original number is 0 (in case the stage number is negitive)
end
print(amount,stagesskipped)--the amout is the stage of which the player's stage should be at and stageskipped is the amount of stages the player skipped
1
use a gamepass Leamir 3138 — 4y
1
Could it be done as a dev product? thestorm2897 10 — 4y
0
he wants it so if the stage is 49 the stage will be 50 if it is 25 it will be 50 if it is 52 it will be 100 you get the idea botw_legend 502 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local amount
local stagesskipped
local stages = -put the players stage here
for i = 1,50 do-- 50 is the max amount of times the for statement will have to run
    local number = stages+i
    local end2 = string.sub(number,string.len(number)-1,string.len(number))--this gets the last two numbers of the stage
    if tonumber(end2) == 00 or tonumber(end2) == 50 or tonumber(number) == 0 then amount = number stagesskipped = i end-- if the number ends in 00 50 or the original number is 0 (in case the stage number is negitive)
end

hope this helped!

0
tell me if there are any bugs! botw_legend 502 — 4y
1
ok let me give it a try thestorm2897 10 — 4y
1
17:29:42.843 - Players.thestorm2897.PlayerGui.SkipStageScript:4: Expected identifier when parsing expression, got 'do' thestorm2897 10 — 4y
Ad

Answer this question