Im currently using a modified version of roblox’s safe teleport module to teleport all of the players into the game, but sometimes i get the “Error Code: 773, Attempted to teleport to a place which is restricted.”
It seems to happen randomly and, for some reason, only to me?
If anyone has found a solution to this problem or if any code pieces are needed, then let me know!
Make sure you’re correctly using the privateServerAccessCode returned from TeleportService:ReserveServer(), sounds like it could be an issue with that.
(also make sure you have permission to teleport to the desired place)
It’s a pretty simple change, where i also pass the privateServerAccessCode when calling the function and instead of using TeleportAsync i use TeleportToPrivateServer
full function:
local function SafeTeleport(placeId, reservedId, players, options)
local attemptIndex = 0
local success, result -- define pcall results outside of loop so results can be reported later on
repeat
success, result = pcall(function()
return TeleportService:TeleportToPrivateServer(placeId, reservedId, players, "", options) -- teleport the player in a protected call to prevent erroring
end)
attemptIndex += 1
if not success then
task.wait(RETRY_DELAY)
end
until success or attemptIndex == ATTEMPT_LIMIT -- stop trying to teleport if call was successful, or if retry limit has been reached
if not success then
warn(result) -- print the failure reason to output
end
return success, result
end
Do you have ThirdPartyTeleports enabled in-game? For some reason, you have to enable it sometimes to teleport to places under the same universe. Happened to me, I have no idea why.
Same. I’m trying something right now, where I check the playerlist to see if someone thats supposed to be gone is still there, and solo teleporting them directly. I’ll report back if its successful or not, you could try that
@fr3akko Are you still encountering this within your game? What you’ve described is also an issue for me and I can’t seem to find a solution. I’m wondering if you were able to solve the problem or if there’s something wrong with Roblox
Does this mean teleporting the players into a separate Experience or a Place within one? I was working on a project a few years ago and I managed to figure it out well.
If it’s a Place, I would recommend making it connected to the first Experience directly. This means there can be no correlation between other Places and teleportation should work perfectly every time.
If it’s a separate Experience, the one you want to teleport the players to should be public, but making sure the players have joined through the initial Experience rather than finding it some other way (e.g. from another Experience).
This is exactly what happened with me. Once the previously encountered problems are solved, this should no longer be a problem.
I’m pretty sure it’s an issue on Roblox’s end if it’s all something we started experiencing a week ago. I can also attest to everything he’s described (the issue only happens with more than one player, usually involving different regions)… Very frustrating because I don’t have the permissions to submit bug reports on the DevForum.
I am having the same issue. I believe it may be caused by two players from different regions attempting to teleport to a reserved server together. Hopefully they get around to this.
I am back with some good news. Earlier this morning I found a way around this issue.
You can use the TeleportService.TeleportInitFailed event to handle players getting the Error Code 773 teleport restriction. While the error will still appear for them, they’ll teleport to the reserved server eventually with this setup. I was skeptical about this solution, since it involved retrying a teleport to a private server, but no, it works completely fine.
I took some code from the documentation and edited it to fit within my game:
local TeleportService = game:GetService("TeleportService")
local RETRY_DELAY = 1
local FLOOD_DELAY = 15
local function handleFailedTeleport(player, teleportResult, errorMessage, placeId, teleportOptions)
if teleportResult == Enum.TeleportResult.Flooded then
task.wait(FLOOD_DELAY)
elseif teleportResult == Enum.TeleportResult.Failure then
task.wait(RETRY_DELAY)
else
warn(("Invalid teleport [%s]: %s"):format(teleportResult.Name, errorMessage))
wait(1)
end
TeleportService:TeleportAsync(placeId, {player}, teleportOptions)
end
TeleportService.TeleportInitFailed:Connect(handleFailedTeleport)
The code should show the restriction as an invalid teleport warning and retry the teleport again after a second. Just putting it here in case it’s useful to anyone else.