I am trying to create a loading screen system between 2 places. But for some reason, every time I try to get the TeleportLoadingGui, it never works.
Here is the script for the lobby:
local TeleportService = game:GetService("TeleportService")
local GUI = game:GetService("ReplicatedStorage"):WaitForChild("Loading")
TeleportService:SetTeleportGui(GUI)
And the script for the other place is:
local TeleportService = game:GetService("TeleportService")
local RS = game:GetService("ReplicatedStorage")
local RF = game:GetService("ReplicatedFirst")
local TS = game:GetService("TweenService")
local Remotes = RS:WaitForChild("Remotes")
local LoadedEvent = Remotes:WaitForChild("Loaded")
local gui = TeleportService:GetArrivingTeleportGui()
print(gui)
if not gui then
gui = TeleportService:GetArrivingTeleportGui()
end
if gui then
gui.Parent = Players.LocalPlayer.PlayerGui
RF:RemoveDefaultLoadingScreen()
-- Other GUI functions
else
-- Didn't work
Players.LocalPlayer.PlayerGui:WaitForChild("ScreenGui"):WaitForChild("TextLabel").Visible = true
end
Everytime I attempt to get the arriving GUI, i get returned with nil.
Any help is appreciated!