I am making a Place Roulette game, and attempting to teleport to these random places using :TeleportAsync causes very consistent errors for the majority of the time.
These errors are quite vague. I have been searching on the Devforum for any solutions, but to no avail. The official documentation doesnt list these errors and their meaning, either:
Errors in Multiplayer sessions:
A specified Member cannot join the Destination Place.
The Source Place and the Destination Place are not in the same Universe.
Errors in Singleplayer sessions:
773: Teleport validation failed
773: Game’s root place is not active.
My code is quite simple:
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local PlaceChecker = require("@self/PlaceChecker")
local Teleport = ReplicatedStorage:WaitForChild("Teleport")
local IsTeleporting = ReplicatedStorage:WaitForChild("IsTeleporting")
local placeQueue = {}
local function ChooseRandomPlace()
local placeId : number = nil
local isPlaceValid = false
repeat
local digits = {}
for i = 1, 10 do
table.insert(digits, math.random(0, 9))
end
placeId = table.concat(digits)
local placeInformation = PlaceChecker:FetchPlaceInfo(placeId)
if placeInformation.isPlace then
isPlaceValid = true
print(`PLACE SUCCESSFULLY FOUND. PLACEID: {placeId}, NAME: {placeInformation.name}`)
end
until isPlaceValid
return placeId
end
local function StartRoulette()
IsTeleporting.Value = true
local placeId = ChooseRandomPlace()
if placeId then
local success, errorMsg = pcall(function()
TeleportService:TeleportAsync(placeId, Players:GetPlayers())
end)
if not success then
warn(`ERROR OCCURED: '{errorMsg}'`)
end
end
task.wait(0.1)
IsTeleporting.Value = false
end
Teleport.Event:Connect(StartRoulette)
How can these errors be fixed? Thank you in advance.
Go to Asset Manager > Places then right click then press “Add New Place”,
Then right click the Place you just made then press “Copy ID to Cilpboard”
Hmm, is the destination place also public and published?, That could be a problem?
Also i’d advise using the Safe Teleport Module by Roblox, It’s located in the “Handle Failed Teleports” Section.
Go to your Place in create.roblox.com > Audience > Access Settings and make sure “Allow direct access to places” is enabled, or the Safe Teleport Module could fix that.
The other suggestions did not fix my issue. The Safe Teleport Module just repeated the error 5 times in a row, technically, and I also already had Allow direct access to places already on, seemed to be automatic.
This didn’t seem to work, but correct me I did the process incorrect:
Created a new side place. (Asset Manager > Places > Add New Place)
Copied the place’s ID to my Clipboard
Applied the new ID to the starting place with the method game:SetPlaceId()
Removed the Side Place
Published the game
These errors still occur. I did this in a duplicate version of my current game just for safety reasons, but everything is identical, age rating and settings included.
What is applying a new PlaceId achieving exactly? If the Destination Place isn’t created, isn’t that a problem on the developers end, not mine? That would probably mean I need to get it’s isPlayable value via HttpService.
It appears that a lot of these errors stem from the place being unavailable, private, or content deleted.
The error The Source Place and the Destination Place are not in the same Universe. Seems to occur when the PlaceId generated is the PlaceId of a side place, not the main game.
With that said, I have a few ideas on how to fix these:
Using HttpService to check the availability of a place
Checking if the game is a side place, and possibly switching the PlaceId to the starting place, if this is possible.
I won’t mark this as a solution just yet, as I’ll still have to look into good fixes for these issues. Preferably, I’d like to wait on Roblox for opening up some endpoints needed for getting this info, but I’ll still see if I can make a Proxy if takes a while.