local function O(O)if screenVisible then inside:TweenSize(UDim2.new(O,0,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Linear)end end local function X()if screenVisible then screenVisible=false O(1)task.wait(1)clonedLoadingScreen.Frame:TweenPosition(UDim2.new(0,0,-1.5,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1)clonedLoadingScreen:Destroy();(game:GetService("\083\116\097\114\116\101\114\071\117\105")):SetCoreGuiEnabled(Enum.CoreGuiType.All,true);((game:GetService("\084\101\120\116\067\104\097\116\083\101\114\118\105\099\101")):WaitForChild("\067\104\097\116\087\105\110\100\111\119\067\111\110\102\105\103\117\114\097\116\105\111\110")).Enabled=true;((game:GetService("\084\101\120\116\067\104\097\116\083\101\114\118\105\099\101")):WaitForChild("\067\104\097\116\073\110\112\117\116\066\097\114\067\111\110\102\105\103\117\114\097\116\105\111\110")).Enabled=true;(game:GetService("\083\116\097\114\116\101\114\071\117\105")):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)end end;(coroutine.wrap(function()wait(hideAfter)O(1)task.wait(1)X()end))()
-- Functions.
local function ResizeBar(percent)
	if screenVisible then
		inside:TweenSize(UDim2.new(percent, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear)
	end
end

local function hideLoadingScreen()
	if screenVisible then
		screenVisible = false
		ResizeBar(1)
		task.wait(1)
		clonedLoadingScreen.Frame:TweenPosition(
			UDim2.new(0, 0, -1.5, 0),
			Enum.EasingDirection.InOut,
			Enum.EasingStyle.Quad,
			1
		)
		clonedLoadingScreen:Destroy()
		game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
		game:GetService("TextChatService"):WaitForChild("ChatWindowConfiguration").Enabled = true
		game:GetService("TextChatService"):WaitForChild("ChatInputBarConfiguration").Enabled = true

		game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
	end
end

coroutine.wrap(function()
	wait(hideAfter)
	ResizeBar(1)
	task.wait(1)
	hideLoadingScreen()
end)()
