Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo)
end
local players = game.Players:GetPlayers()
local currency = "Stage"
local done = 0
for i=1,#players do
if players[i].userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == 1120029971 and done == 0 then
done = 1
local Stage = players[i].leaderstats.Stage.Value
players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + 1
players[i].Character.Humanoid.Health = 0
local StagePart = workspace.Stages:FindFirstChild(Stage.Value)
local Humanoid = character:WaitForChild("Humanoid")
local Torso = character:WaitForChild("HumanoidRootPart")
wait()
if Torso and Humanoid then
local StagePart = workspace.Stages:FindFirstChild(Stage)
character:MoveTo(StagePart.Position)
end
done = 0
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end``
COMMUNITY QUESTION
How do I get teleported to the checkpoint of the next stage of my obby when I buy a dev product?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I have no idea how to figure this out, if anyone can come up with an answer that would be great.