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