Why my game Teleport fail

I’m using TeleportService:TeleportReserverServer and TeleportPrivateServer

My players see that error phrase once in a while.

It’s been three days already. I’m so sorry for the players.

Do you know how to solve the problem?

Or do you know the cause?

Thank you for always helping Hub users.

if PlayerCounts >= 2 then
			local success, err = pcall(function()
				if Server:FindFirstChild("Timer").Value <= 0 then
					print("Teleporting")
					local code = TS:ReserveServer(placeId)
					
					--[[
					for i,v in pairs(PlayerTable:GetChildren()) do
						v.PlayerGui.PopupGui.FakeLoading.Visible = true
					end
					]]--
					--TS:TeleportPartyAsync(placeId,PlayerTable)
					local TeleSuccess, TeleErr = pcall(function()
						warn("Teleporting...")
						TS:TeleportToPrivateServer(placeId,code,PlayerTable)
					end)
					if not TeleSuccess then
						warn("TeleportError Refresh")
					end
					if Server:FindFirstChild("Timer").Value <= 0 then
						for i,v in pairs(PlayerTable) do
							print("Match System")
							game.ReplicatedStorage.TeleportingUiPopUp:FireClient(v)
							MatchModule.cancelmatch(v)
							wait(.2)
						end
					end
				end
			end)
			if not success then
				warn("Can not Teleporting")
			end

Please copy your code into text format and paste it, then format it with ```.

1 Like

In your case, I’d say you should check TeleportInitFailed and perhaps call pcall on your TeleportService:ReserveServer().

2 Likes

When the game tries to teleport a user to a place, it will check whether or not the player has certain permissions to enter the game. If the place is not public and has restrictions (e.g. the game is private, the game can only be played by certain Group Members, etc.) and the user does not meet the qualifications, the teleport will fail.

1 Like

Make sure that the game is public or everyone playing has access to the game AND that the place that they are teleporting to supports all of the platforms (like Xbox or PC) as the lobby place.

1 Like