This function fires when the
Players/LocalPlayer enters the place following a teleport. The teleportData and customLoadingScreen are provided as arguments.
When fetching teleportData and the customLoadingScreen you are advised to use
TeleportService/GetArrivingTeleportGui instead. This is because these functions can be called immediately without having to wait for this event to fire.
This event should be connected immediately in a
LocalScript parented to
ReplicatedFirst. Otherwise, when the connection is made the event may have already fired.
During a teleport, whilst the destination place is loading, the customLoadingScreen is parented to the
CoreGui. Once the place has loaded the
ScreenGui|loading screen is
Instance/Parent|parented to nil.
If you wish to preserve the customLoadingScreen and perform your own transitions, you will need to parent it to the
PlayerGui. For example, using the following code inside a
local TeleportService = game:GetService("TeleportService") local Players = game:GetService("Players") local ReplicatedFirst = game:GetService("ReplicatedFirst") TeleportService.LocalPlayerArrivedFromTeleport:Connect(function(customLoadingScreen, teleportData) local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui") ReplicatedFirst:RemoveDefaultLoadingScreen() customLoadingScreen.Parent = playerGui -- animate screen here wait(5) -- destroy screen customLoadingScreen:Destroy() end)
Note, the customLoadingScreen will not be used if the destination place is in a different game.
The customLoadingScreen the
The teleportData the