TeleportToPlaceInstance Unable to Teleport questions

Every time I use TeleportToPlaceInstance, I receive this error. I am certain that I have made my game public and enabled the relevant API services, but none of it has any effect.

Has anyone had this issue before? Is there any other way I could go about fixing this?

4 Likes

Is this on roblox studio or on the game engine? If the place you’re trying to teleport to a game that is private this can cause this error.

3 Likes

This is in the game, if in the Studio, it will return a 403 Forbidden error.

2 Likes

I searched about this error and one solution was to use TeleportAsync

1 Like

I’ve tried using TeleportAsync, but it ultimately still returns an “Unable to join Game 312 (Unauthorized)” error. I’ve never encountered the “312” code, and I haven’t found any relevant information on the forums.

It will display “Attempted to teleport to a place that is restricted. Error Code: 773”

Then, an “Unable to join Game 312 (Unauthorized)” error will appear in the console.

2 Likes

Huh that’s very weird, can you show the place id ur trying to teleport to?

This can also be because of Allow Third Party Teleports is disabled in the other game your trying to teleport to. I am not sure what’s causing this error.

1 Like

I’m try to teleport to the server of a specified player within this game (a teleport between servers of the same game, not involving servers of other games).

1 Like

You need to specify the JobID of the server instance you are trying to join EG

game:GetService("TeleportService"):TeleportToPlaceInstance(PlaceID,JobID,Player)

PlaceID - This is the ID of the place you are joining
JobID - This is the ID of one of the specific servers of the place you are trying to join
Player - This is the PlayerModel you are teleporting NOT the person you are teleporting to

Do note if this player is in a private server or the server is full you will not be able to join under any circumstances

If you only need to teleport to a place and not a specific server of that place just use TeleportAsync

2 Likes
game:GetService("ReplicatedStorage").Remote.ServerTP.OnServerEvent:Connect(function(mod, goplr)
	local function TeleportToPlayerServer(player)
		local gotoplr = goplr.UserId
		local playerName = player
		local targetPlayer = nil
		for _, playerX in ipairs(game.Players:GetPlayers()) do
			if playerX.Name == playerName then
				targetPlayer = playerX
				break
			end
		end
			local _currentInstance, _, placeId, jobId
			local success, errorMessage = pcall(function()
				_currentInstance, _, placeId, jobId = game:GetService("TeleportService"):GetPlayerPlaceInstanceAsync(gotoplr)
			end)
			if success then
				local Tplr = game.Players:GetNameFromUserIdAsync(goplr.UserId)
				--local teleportOptions = Instance.new("TeleportOptions")
				--teleportOptions.ServerInstanceId = jobId
				print("placeId " .. placeId .. " typeof " .. typeof(placeId))
				print("jobid " .. jobId .. " typeof " .. typeof(jobId))
				print("tp plr " .. Tplr .. " typeof " .. typeof(Tplr))
				--game:GetService("TeleportService"):TeleportAsync(placeId,{targetPlayer},teleportOptions)
				game:GetService("TeleportService"):TeleportToPlaceInstance(placeId, jobId, targetPlayer)
			else
				warn(errorMessage)
				print(goplr.Name .. " is not in any server.")
			end
	end
	local success1, err1 = pcall(function()
		if (goplr) then
			TeleportToPlayerServer(mod.Name)
		else
			UiChange:FireClient(mod,"Not Find user")
		end
	end)

	if not success1 then
		warn(err1)
		UiChange:FireClient(mod,"Not Find user")
	end
end)

I will attempt to join the server of a specific player who is playing this game, unfortunately, this code results in an “Unable to join Game 312 (Unauthorized)” issue.

1 Like

This might be a issue on roblox’s side. Never have I seen this error.

1 Like

From what I remember that is either roblox thinking you logged out your account before teleporting, or a byfron issue, the code itself looks just fine.

1 Like

Thank you for your suggestion.
I didn’t log out of my account before teleporting, so I suspect this might be another issue. However, I’m not sure how to resolve this. Do you have any advice?
Additionally, I succeeded once in my attempts yesterday without any error and was able to teleport normally. But ever since then, I have been constantly encountering the “Unable to join Game 312 (Unauthorized)” issue.

1 Like

The issue has been resolved.

All servers created before you join the game can perform teleportation after you join the game;

However, any new game servers created after you join the game will be unable to teleport (Unable to join Game 312 (Unauthorized)).

The solution is to rejoin the game (ensuring that the specified server is not shutdown).

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.