This function returns the customLoadingScreen the
Players/LocalPlayer|LocalPlayer arrived into the place with.
Note, the customLoadingScreen will not be used if the destination place is in a different game.
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 an example of this, see the code sample below.
This service does not work during playtesting in Roblox Studio — To test aspects of your game using it, you must publish the game and play it in the Roblox application.
The customLoadingScreen the
Handling a Teleport Loading GUI
The following code, when placed inside a
ReplicatedFirst will preserve a custom teleport loading screen for five seconds before destroying it.
local TeleportService = game:GetService("TeleportService") local Players = game:GetService("Players") local ReplicatedFirst = game:GetService("ReplicatedFirst") local customLoadingScreen = TeleportService:GetArrivingTeleportGui() if customLoadingScreen then local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui") ReplicatedFirst:RemoveDefaultLoadingScreen() customLoadingScreen.Parent = playerGui -- animate screen here wait(5) -- destroy screen customLoadingScreen:Destroy() end