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.
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.
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.
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).
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
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.
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.
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.