Jump to content

How do i make the loading screen play without any other GUIs?


Recommended Posts

Im working on a game and i currently have 6 GUIs on Player Gui, and 1 Gui which is the loading screen on Replicated First, i made a script so that the Gui plays when someone joins and then is destroyed, but all of the of the Guis appear in the screen with the loading screen an dit looks really bad, i wonder how do you make only the loading screen play and after the loading screen dissapear the other Guis appear. Can someone help me?

813088990_Screenshot(44).thumb.png.79b5dfcadf5a3e42976282fb321c6a1c.png

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()

 

 

 

Share this post


Link to post
Share on other sites

I can think of many solutions. You can increase the ZIndex of said loading screen, tween the UIs onscreen when the loading GUI gets destroyed, make them invisible until the loading screen is finished, etc.

Share this post


Link to post
Share on other sites
1 hour ago, Mystic_StarShowers said:

I can think of many solutions. You can increase the ZIndex of said loading screen, tween the UIs onscreen when the loading GUI gets destroyed, make them invisible until the loading screen is finished, etc.

Do you know how to make them invisible until the loading screen is finished? i tried increasing the index but it did not work

Share this post


Link to post
Share on other sites

Hello SparksXRoblox if you have a ScreenGui For all the Main UIs then add this 

 

local Player = game:GetsService("Players").LocalPlayer

Player:WaitForChild("PlayerGui"):FindFirstChild("The Name Of The SceeenGui").Enabled = false

then where you destroy the other stuff just add the same like just make it true

Player:WaitForChild("PlayerGui"):FindFirstChild("The Name Of The SceeenGui").Enabled = true

 

My Time Zone Is EST i just happen to be up at 3am If you have any other questions my discord is BlastmanX20#4755

 

 

 

 

 

 

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)

------------------------------AREA TO ADD THE CODE--------------------------------------------

 

 

--------------------------------------------------------------------------------------------------------

--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()

------------------------------OTHER AREA TO ADD THE CODE--------------------------------------------

 

 

--------------------------------------------------------------------------------------------------------

 

Edited by BlastmanX20YT

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.