My Loading Screen not Working Properly

Hi There!!

Just like the title says, my loading screen is not working properly, I have it wait 7 seconds but it goes away immediately… Here is a video:


0:24 is when it starts…

My Script:

game.ReplicatedFirst:RemoveDefaultLoadingScreen()

local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")

PlayerGui:SetTopbarTransparency(0)

local GUI = script.LoadingScreen:Clone()

GUI.Parent = PlayerGui

wait(7)

GUI.BackGround:TweenPosition(UDim2.new(0,0,1,0),"InOut","Sine",0.5)

wait(0.5)

GUI:Destroy()

Screenshot in ReplicatedFirst:

image
Hope you can help!! :grin:

I watched @Alvin_Blox in this video:

Your game is taking a while to load in so the loading screen has already disappeared.

Change

GUI.Parent = PlayerGui

wait(7)

GUI.BackGround:TweenPosition(UDim2.new(0,0,1,0),"InOut","Sine",0.5)

to something like this

GUI.Parent = PlayerGui

wait(15)

GUI.BackGround:TweenPosition(UDim2.new(0,0,1,0),"InOut","Sine",0.5)

Or you could do:

 repeat wait() until game:IsLoaded() == true

The Roblox API says that you should use RemoveDefaultLoadingScreen() after parenting the GUI to the player. Right now, it looks like you are using RemoveDefaultLoadingScreen() first. Try doing that if @Little_Joes suggestion doesn’t work.

if not game:IsLoaded() then
game.Loaded:Wait()
end

Would be a more efficient way of doing this.