Teleport failed

I’m trying to teleport a player from the lobby to the main game. I tried doing this but it worked the first time I did it but now it’s not. I don’t know what’s wrong with it. tysm in advance

local Part = script.Parent

local TeleportService = game:GetService('TeleportService')

local placeID = 5789355763

local canTP = true

local function otherGame(otherPart)
	local player = game.Players:FindFirstChild(otherPart.Parent.Name)
	if player and canTP then
		print("A")
		canTP = false
		TeleportService:Teleport(placeID, player)
	end
end

Part.Touched:Connect(otherGame)
1 Like

You forgot to pass in the “otherPart” Argument.

1 Like

? sorry I don’t understand wdym

1 Like

Oh, never mind. Make sure in your game settings you allow third party teleports. Also if you are testing in roblox studio it won’t work.

they do and I tested it out of Roblox studio

Can I have a screenshot of this error message?