Here's the script for the dev product: ~~~~~~~~~~~~~~~~~ local productId = 915594981 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) end)
Here's the things to skip the stage:~~~~~~~~~~~~~~~~~ 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 == 915594981 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
Whenever I buy the product, it increases my stage value, but it won't teleport me to the spawn point of that stage.
I don't see you teleporting the player anywhere in your script.
What I see you trying to do is set the stage to [current+1], and then killing the player, which is not an extremely effective way of doing it. Personally, I would alter the player's CFrame like so..
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 == 915594981 and done == 0 then done = 1 players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + 1 game.Workspace[players[i].Name]:WaitForChild("HumanoidRootPart").CFrame = CFrame.new([Spawn Position] + Vector3.new(0,3,0)) done = 0 end end end return Enum.ProductPurchaseDecision.PurchaseGranted end
Of course, change [Spawn Position] on line 15 to the position of the stages spawn point.
The change made is on line 15. I took out you killing the player, and teleported them to the spawn point instead.