Video: https://www.youtube.com/watch?v=FQ5zayujy1s&feature=youtu.be (The "Waiting for Players" screen is separate, not the screen we selected for :SetTeleportGui)
Hello all, I am using :ReserveServer, and when I teleport the player, :SetTeleportGui is not working. These are one player servers for the title screen, by the way.
Server Code (Game we are getting teleported from):
local TS = game:GetService("TeleportService") local Players = game:GetService("Players") game.ReplicatedStorage.Events.TeleportPlayer.OnServerEvent:Connect(function(player, code) game.ReplicatedStorage.Events.PrepareTeleport:FireClient(player) wait(2) local players = Players:GetPlayers() TS:TeleportToPrivateServer(5132212625, code, players) end)
Client Code (Game we are getting teleported from):
local TS = game:GetService("TeleportService") game.ReplicatedStorage.Events.PrepareTeleport.OnClientEvent:Connect(function() local clone = game.ReplicatedStorage.LoadingGUI clone.Parent = script.Parent local loadingScreen = game.ReplicatedStorage:WaitForChild("LoadingGUI") TS:SetTeleportGui(loadingScreen) end)
Client Code (Game we are getting teleported to) (Placed in ReplicatedStorage):
script.Parent:RemoveDefaultLoadingScreen() local gui = game:GetService("TeleportService"):GetArrivingTeleportGui() gui.Parent = game.Players.LocalPlayer.PlayerGui
These scripts give the result given in the video above. Any help is appreciated. Thanks!
ItzHiimnew
Here's a thought: 1) The server is only waiting 2 seconds for the client to set up the gui for teleport. Not that this isn't ample time, just for the sake of trying to fix your issue at any cost, maybe send an OK back to the server after the client has prepared the gui instead of waiting 2 seconds. 2) Do you have to clone the gui before setting it? What if you just set the gui to the one in RS.