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
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!