How to Teleport Player Upon DevProduct Purchase

Hi everyone! I’m making a skip stage script in which people can (obviously) skip stages upon buying a DevProduct, though I’m having an issue getting the player’s Humanoid… How could I do this in order to teleport the player? Thank you :smiley:

local MarketplaceService = game:GetService("MarketplaceService")

MarketplaceService.ProcessReceipt = function(receiptInfo)
	if receiptInfo.ProductId == 1139217913 then
		local receipt = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
        -- I need to get player.Humanoid here but I don't know how to... 
        -- This is a **REGULAR SCRIPT**, not local.
	end
end

It is better to replace “receipt” with “player” since we are getting the player object and that’'s make more sense.

local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
local humanoid = player.Character:WaitForChild("Humanoid")
1 Like