Issue with TeleportOptions not behaving as described in the documentation

I’ve been trying to set up a system for creating new, empty public servers (not servers created through TeleportService:ReserveServer()) for a project I was working on. The intention of this system was to have things that players build save to the “world” which players can rejoin to visit later even if the server has closed, which in that case it would create a new empty public server. I want to use public servers instead of reserved servers for this as I want to have a “quick play” functionality to send a player to any world and leverage Roblox’s TeleportService to decide where they go for me.


According to the documentation under TeleportOptions, a new public server will be created “when TeleportOptions.ServerInstanceId is blank or no matching server is found”. I’ve tested this and it seems to not be the case.

local TeleportService = game:GetService("TeleportService")

local TeleportOptions = Instance.new("TeleportOptions")
TeleportOptions.ShouldReserveServer = false
TeleportOptions.ServerInstanceId = ""

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	TeleportService:TeleportAsync(game.PlaceId, {player}, TeleportOptions)
end)

When the ServerInstanceId is blank and the player is teleported from a public server, the player ends up getting teleported back to the same server they were in (which results in getting kicked with an error due to the server shutting down after the player leaves)

local TeleportService = game:GetService("TeleportService")
local HttpService = game:GetService("HttpService")


script.Parent.ClickDetector.MouseClick:Connect(function(player)
	local TeleportOptions = Instance.new("TeleportOptions")
	TeleportOptions.ShouldReserveServer = false
	TeleportOptions.ServerInstanceId = HttpService:GenerateGUID()
	
	TeleportService:TeleportAsync(game.PlaceId, {player}, TeleportOptions)
end)

When the ServerInstanceId is something random which would result in no matching server found, the player instead does not get teleported at all and gets prompted “Attempted to teleport to a place that is restricted. (Error Code: 773)”.

Example place:

Am I doing something wrong? Is there a different way in which I’m supposed to create a public server?

1 Like

Hrm. Interesting. I’m curious how you would create the empty place id? You’d have to have preset empty places handy for this and how would you dynamically create the game content and publish the place? Game.PlaceId is the id of the place they are coming from. Perhaps thats why they are being sent back to the same server. The teleport is likely trying to send them to the first available server with spots open.

ServerInstanceId refers to just the game.JobId, not the place id. They’re two different things and I’m not trying to create empty places. With the system I described which I needed public servers for there would be preexisting code which would have gameplay functionalities. I need to create new empty public servers under the same place.

I don’t think you can create new empty public server instances for the same placeId. Roblox is going to try to fill pre-existing servers first before creating a new instance. If its going to be the same placeId then why move them to a new server in the first place literally everything will be exactly the same as the server instance they are already in.

I think you could still probably accomplish what you are trying to do with the reserved servers. But you’d need to keep records either in datastore or the new quick data thing I forgot the name of it sorry. Keep records of any open reserved servers and send players there as if it were a public server.

I need this system to create new public servers to load in player-made builds from a previous session shared among many players over the entire map while still allowing other players to join the server and for the server to naturally populate.

I would like to avoid using reserved servers as I want to leverage Roblox’s way of deciding where players should go to avoid issues related to limits and speed of updating what servers are available during peak hours.

The documentation describes TeleportOptions as a way to create new public servers but it’s not working.

I think no matter what, the problem is that the saved changes by the players have to be dynamically created by the server. There is no way to store them other than via datastores. And if it is dynamically generated then there is no issue with using a single place in the experience. If the main instance shuts down because you have zero players. Then when it starts back up again. The server will just remake all the stuff that was stored.