Remove Tools In Soft Shutdown?

Hello,

I’m attempting to hide the player’s backpack/equipped tools meanwhile the game is updating via soft shutdown. I want to have the smoothest custom UI when doing a soft shutdown, and the visible toolbar is unpleasing to the aesthetic of the frame.

Here is what I came up with:

Local Script:

local Core = game.ReplicatedStorage:WaitForChild("Core")

Core.OnClientEvent:Connect(function()
	local player = game.Players.LocalPlayer
	for _, tool in pairs(player.Character:GetChildren()) do
		if tool:IsA("Tool") then 
			tool:Destroy()
		end
	end
end)

Soft Shutdown Script:

--[[
	SoftShutdown 1.2
	Author: Merely
	
	This system lets you shut down servers without losing a bunch of players.
	When game.OnClose is called, the script teleports everyone in the server
	into a reserved server.
	
	When the reserved servers start up, they wait a few seconds, and then
	send everyone back into the main place.
	
	I added wait() in a couple of places because if you don't, everyone will spawn into
	their own servers with only 1 player.
--]]

local Core = game.ReplicatedStorage:WaitForChild("Core")

Core:FireClient(plr)


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

if (game.VIPServerId ~= "" and game.VIPServerOwnerId == 0) then
	-- this is a reserved server without a VIP server owner
	local m = Instance.new("Message")
	m.Text = "This is a temporary lobby. Teleporting back in a moment."
	m.Parent = workspace
	
	local waitTime = 5

	Players.PlayerAdded:connect(function(player)
		wait(waitTime)
		waitTime = waitTime / 2
		TeleportService:Teleport(game.PlaceId, player)
	end)
	
	for _,player in pairs(Players:GetPlayers()) do
		TeleportService:Teleport(game.PlaceId, player)
		wait(waitTime)
		waitTime = waitTime / 2
	end
else
	game:BindToClose(function()
		if (#Players:GetPlayers() == 0) then
			return
		end
		
		if (game:GetService("RunService"):IsStudio()) then
			return
		end
		
		local m = Instance.new("Message")
		m.Text = "Rebooting servers for update. Please wait"
		m.Parent = workspace
		wait(2)
		local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)
		
		for _,player in pairs(Players:GetPlayers()) do
			TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
		end
		Players.PlayerAdded:connect(function(player)
			TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
		end)
		while (#Players:GetPlayers() > 0) do
			wait(1)
		end	
		
		-- done
	end)
end
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

or only backpack:

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
1 Like

Thank you,

I put the Core:FireClient() for each stage of the soft shutdown & it works.