Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make all GUIs disabled while the LoadingGUI is playing?

I made a loading assets Gui and when i play the other guis of the game appear with the Gui and it looks really bad, i wonder if there was a way that i could disable the other guis for 5 seconds or something like that, because i only want the loadingscreen for 5 seconds.

game:GetService("ReplicatedFirst"):RemoveDefaultLoadingScreen()
local cp = game:GetService("ContentProvider")
local optionalAssets = {}
local disabledServices = {
	["Lightning"] = false;
	
} --services not to preload
local ui = script:WaitForChild("laodingUI")
ui.Parent = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local blur = Instance.new("BlurEffect", game:GetService("Workspace").CurrentCamera)


--preloading
warn("starting preload")
local startTick = tick()
--preload the optional assets first
cp:PreloadAsync(optionalAssets)

--preload the entire game

for i,service in pairs(game:GetChildren())do
	pcall(function()
		if not disabledServices[service.Name] then
			--warn("service not disabled")
			cp:PreloadAsync((service))
		end
	end)
end
wait(10)
warn("preload done, time:"..string.sub(tick()-startTick,1 ,5).."s")
ui:Destroy()
blur:Destroy()

2 comments

0

set all of the guis visibility to false at the top and after the Destroy()'s set it to true. i wonder if theres an event that waits for the loading GUI though.

0

I answered the easier way to do it

1 answer

There is a far easier way to do this. To accomplish what your trying to do AKA make only the loading screen visible, go to the loading screen's main frame. From there change the Zindex to 100. That means it will appear in front of all other GUIs, consequentially making them appear invisible. I hope I was able to help. With further questions/comments/concerns, feel free to comment on my answer. ~mc3334

1 comment

0

i changed the zindex but nothing happened, btw the loadingGui its in Replicated First and the other Guis are in StarterGui

This discussion is preserved as it was. New answers, comments, and votes are closed.