Help with custom loading screen?

Hello Developers! I need help with my soft shutdown script! The script is working fine but it does not show my Teleport GUI the entire time when teleporting players to and from the reserved server. I wish to remove the loading screen that appears in the middle of the teleport!

I have tried to Remove the default loading screen through a local script in Replicated First:

game.ReplicatedFirst:RemoveDefaultLoadingScreen()

Any Solutions?

Here is my code:

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")


if game.PrivateServerId ~= "" and game.PrivateServerOwnerId == 0 then
	local waitTime = 5

	players.PlayerAdded:Connect(function(player)
		local d = script.SoftShutDown:Clone()
		d.Parent = player:WaitForChild("PlayerGui")

		wait(waitTime)
		waitTime = waitTime / 2
		
		TeleportService:Teleport(game.PlaceId, player)
	end)
	
	
	for i, player in pairs(Players:GetPlayers()) do
	
		
		local d = script.SoftShutDown:Clone()
		d.Parent = player:WaitForChild("PlayerGui")
		wait(5)
		TeleportService:Teleport(game.PlaceId, player)
		wait(waitTime)
		waitTime = waitTime / 2
	end

elseif RunService:IsStudio() == false then
	game:BindToClose(function()
		spawn(function()
			local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)
			for _, player in pairs(Players:GetPlayers()) do
				local d = script.SoftShutDown:Clone()
				d.Parent = player:WaitForChild("PlayerGui")
				
				
				TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, {player})
			end
			Players.PlayerAdded:Connect(function(player)
				local d = script.SoftShutDown:Clone()
				d.Parent = player:WaitForChild("PlayerGui")
				TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, {player})
			end)
		end)
		while #Players:GetPlayers() > 0 do
			wait(1)
		end
	end)	
end
3 Likes

After calling TeleportService set the Teleport Gui:

TeleportService:SetTeleportGui(CustomTeleportGui)
1 Like

Hello! I saw this and I would like to help. If you watch AlvinBloxs video on custom loading screens it is very useful. Also if you want the roblox tutorial go here Customizing Loading Screens | Roblox Creator Documentation.

1 Like

Ow Thanks! This actually works! I had to put the code into a local script

1 Like