How could I make this happen?

How can I make it so that when the game is loading all gui will not show unless it’s the loading gui and the gui will show after loading I am talking roblox core ui and custom? I have tried some things but am very new to scripting!

local ReplicatedFirst = game:GetService(“ReplicatedFirst”)
local ContentProvider = game:GetService(“ContentProvider”)
local TweenService = game:GetService(“TweenService”)
local Player = game:GetService(“Players”).LocalPlayer
local screen = script.Parent.Parent.LoadingScreen
local hide_gui = {Enum.CoreGuiType.Chat, Enum.CoreGuiType.Backpack, Enum.CoreGuiType.EmotesMenu, Enum.CoreGuiType.PlayerList}
local Main = script.Parent:WaitForChild(“Main”)
local Holder = Main:WaitForChild(“Holder”)
local visibles = {}
local StarterGui = game.StarterGui
ReplicatedFirst:RemoveDefaultLoadingScreen()

local Assets = game:GetDescendants()

for i, g in pairs(hide_gui) do
visibles[g] = StarterGui:GetCoreGuiEnabled(g)
end

for i = 1, #Assets do
local Asset = Assets[i]
local Percentage = math.round(i/#Assets * 100)

ContentProvider:PreloadAsync({Asset})

Holder.AssetsLoaded.Text = "Loading Assets ("..i.."/"..#Assets..")"

TweenService:Create(Holder.Bar, TweenInfo.new(0.1, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Size = UDim2.fromScale(Percentage/100, 1)}):Play()

if i % 5 == 0 then
	wait()
end

if i == #Assets then
	wait(1)
end

end

local OutTI = TweenInfo.new(1, Enum.EasingStyle.Quint)

TweenService:Create(Main, OutTI, {BackgroundTransparency = 1}):Play()

for i, ui in pairs(Main:GetChildren()) do
if ui.ClassName == “Frame” then
StarterGui:SetCoreGuiEnabled(g, false)
TweenService:Create(ui, OutTI, {BackgroundTransparency = 1}):Play()
TweenService:Create(ui.Bar, OutTI, {BackgroundTransparency = 1}):Play()
TweenService:Create(ui.AssetsLoaded, OutTI, {TextTransparency = 1}):Play()

elseif ui.ClassName == "TextLabel" then
	TweenService:Create(ui, OutTI, {TextTransparency = 1}):Play()
end

if ui:FindFirstChildWhichIsA("UIStroke") then
	local Stroke = ui:FindFirstChildWhichIsA("UIStroke")
	
	TweenService:Create(Stroke, OutTI, {Transparency = 1}):Play()

end

end

1 Like

i mean could yu just

local LoadingGui = --path to loading gui
LoadingGui.Enabled = true
-- maybe do the tween here
wait(game:IsLoaded())
LoadingGui.Enabled = false

not to sure if this will work…

1 Like

I will try and update u and this post if it works!

1 Like

also I meant core ui like the ui u see on top of your screen from roblox like chat ect