Hi im currently working on my game “Galatic Mayhem” and ive encountered a Problem,
So when the players teleport to the other game i want there to be a loading screen. What ive done, is a event the call the client to set the loading screen so just. Teleport Service:SetTeleportGUI(guiName) and then in the other game in a script in replicated first ive done this for the loading screen
local playerGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local LoadingScreen = TeleportService:GetArrivingTeleportGui()
if LoadingScreen then
ReplicatedFirst:RemoveDefaultLoadingScreen()
LoadingScreen.Parent = playerGui
wait(5)
else
end
LoadingScreen:Destroy()
But what ive seen (with using print ) is that the loading screen is nil, im not sure why, this is my Script that set the loading GUI (Localscript)
local gui = game.ReplicatedStorage.LoadingScreen:Clone()
local tele = game:GetService("TeleportService")
game.ReplicatedStorage.LoadingScreenEvent.OnClientEvent:Connect(function()
local code = tele:ReserveServer(5020544104)
gui.Parent = game.Players.LocalPlayer.PlayerGui
tele:SetTeleportGui(gui)
tele:TeleportToPrivateServer(game.PlaceId,code,,game.Players.LocalPlayer,nil,gui)
print("Teleported")
end)
end)
Thank You