TeleportFunction of TeleportService
void Teleport (
Player player = nil,
ScreenGui customLoadingScreen = nil
Description: Used to teleport a player to the place with ID placeId. The given teleportData can be any value that can be stored in a datastore, and will be transported along with the player. The customLoadingScreen is a GUI that'll be made static (scripts don't run, TweenPosition etc doesn't work, ...) and displayed during teleporting. You can see these arguments after the player has been teleported, using LocalPlayerArrivedFromTeleport.
- The teleportData parameter can be excluded, as Variants can be nil.
The code below will teleport a player to Crossroads, assuming it's in a LocalScript.
The code below will teleport a player to Crossroads, from a server side Script. This assumes that there's a player named 'Telamon' present.
Tutorials Used In