API:Class/TeleportService/LocalPlayerArrivedFromTeleport

LocalPlayerArrivedFromTeleport

Event of ExplorerImageIndex70.pngTeleportService
RBXScriptSignal LocalPlayerArrivedFromTeleport (
    ScreenGui loadingGui,
    Variant dataTable
)
Parameters:
  1. loadingGui
  2. dataTable

Description: The teleportData and customLoadingScreen from the Teleport methods. This event has to be connected by a localscript in the ReplicatedFirst as soon as the script runs, as connecting to the event later can lead to missing it firing.

Example

The code below will handle removing the customLoadingScreen and output the contents of the teleportData table. It should be used in a LocalScript in ReplicatedFirst.

game:GetService('TeleportService').LocalPlayerArrivedFromTeleport:connect(function(customLoadingScreen, teleportData)
	for key, value in pairs(teleportData) do
		print(key.. " = " ..value)
	end
 
	game.Players.LocalPlayer.CharacterAdded:wait() -- Wait for the character to spawn before removing the loading GUI
	customLoadingScreen:Destroy()
end)
Since this function is handled locally on the client sensitive information about the character (such as stats, health, items) should not be passed via dataTable.