TP Script Not Working

My script it not working could I have some help?
There is no console errors.
I am trying so if you buy a dev product it TPs you to a part.
This script is in server script service.

local MarketPlaceService = game:GetService('MarketplaceService')
local id = 1181233760

MarketPlaceService.ProcessReceipt = function(receiptInfo)
	for i, player in ipairs(game.Players:GetChildren()) do
		if player.userId == receiptInfo.PlayerId then
			if receiptInfo.ProductId == id then
				player.Character:MoveTo(workspace["GoldenSpawn"].Position)
				return Enum.ProductPurchaseDecision.PurchaseGranted
			end
		end
	end
end
3 Likes
local MarketPlaceService = game:GetService('MarketplaceService')
local id = 1181233760

game.Players.PlayerAdded:Connect(function(player)
    if(MarketplaceService:UserOwnsGamePassAsync(player.UserId, id ))then
        print("this means the player has the gamepass")
    end
end)

try this

1 Like

I am trying so if you buy a dev product it TPs you to a part not just to prompt purchase. (i have that in another script)

Found the issue! - No more help needed.