Teleport Player To A Public Server

For Example, My party just completed a dungeon and now needs to be teleported to a public server. How would i achieve this?

1 Like

You can find the answer here: Teleporting Between Places | Roblox Creator Documentation

The Roblox doc page has great information on nearly all of the API. Please make sure to check it out before creating a post on here.

You can do this through places in a game, or “universe”
A universe is a collection of places that you can teleport between.
I’m not sure if you can use this functions to teleport to external games, but you can try it if you’d like.

You can do this through a server-side script using TeleportService:

local teleportService = game:GetService("TeleportService")
local players = game:GetService("Players")
local playersToTeleport = players:GetChildren() -- Gets all the players in the server

local placeId = 1 -- Change this to whatever place id you want players to be teleported to

local function teleportPlayersToLobby() -- Can be triggered through any event, you could even put this in a ModuleScript to call this function from anywhere
	teleportService:TeleportAsync(placeId, playersToTeleport) -- Teleports all players, you can add TeleportOptions if you'd like
end

workspace.Part.Touched:Connect(teleportPlayersToLobby) -- Example event to call the teleportation function

Keep in mind that this method can only be playtested after the game is published, and only in the Roblox application, not Studio.

Hope this helps!