GUI Appearing as Primary before Everything:

Hello, everybody!

I was hanging around and I decided to take a little visit to one of the old events created by the Roblox platform, Egg Hunt 2019: Scrambled in Time.

While looking into the minimalistic environment, I went to one of the little areas where you could get teleported to a multi-place and further noticed that, while having the loading screen and half of my character being added to the game, as well as in-game’s assets, I analysed that there is a GUI that any time you teleport, it will always appear as “primary”.

Quite reviewing over, and over again, it seems that they deleted the default loading screen, but to make it quick, that leads me to consider it a bit of a mystery…

Does anyone know how it can be possible to structure a script?

Thank you!

1 Like

This is a parameter to TeleportService.Teleport.

1 Like

Yes, I got that too (I forgot to put in the topic’s description)! Although, while reading through the documentation, does it have any relation to the instance GetArrivingTeleportGui?

I think this Roblox Document will help you out!

It informs us how we can change the Roblox Default Loading Screen to a custom one.

Both GetArrivingTeleportGui & SetTeleportGui are just the preferred alternatives, as it can be called prior to the teleport

I don’t think there’s really any difference about it performance wise, but just as long as you set a Teleport UI parameter for the function to pass through, and call GetArrivingTeleportGui back in another place (Within the same game) you should be fine

  • Place #1 in a LocalScript:
local TPService = game:GetService("TeleportService")
local RS = game:GetService("ReplicatedStorage")
local Plrs = game:GetService("Players")

local TeleportUI = RS:WaitForChild("TeleportUI")

local Plr = Plrs.LocalPlayer
local PlrGui = Plr:WaitForChild("PlayerGui")

local PlaceID = 0000000

TeleportUI.Parent = PlrGui

  • Place #2, same scenario except we replace SetTeleportGui with GetArrivingTeleportGui (ReplicatedFirst also has a method to remove the Default Loading Screen)
local TPService = game:GetService("TeleportService")
local Plrs = game:GetService("Players")
local RF = game:GetService("ReplicatedFirst")

local Plr = Plrs.LocalPlayer
local PlrGui = Plr:WaitForChild("PlayerGui")

RF:RemoveDefaultLoadingScreen() -- We remove this and replace it with our own loading screen

local ExpectedUI = TPService:GetArrivingTeleportGui()

if ExpectedUI ~= nil then -- This can return back as "nil", keep in mind that
    ExpectedUI.Parent = PlrGui
1 Like