I'm working on a game and i made a loading screen for it , but while the loading screen is visibile the top bar isn't covered by the gui , how can i fix it?
Picture of what i mean : https://imgur.com/a/hwfcqOA
That's my code for the loading screen :
local screen = math.random(1,3)
if screen == 1 then print '1' script.Parent.Parent.Parent.Parent.Enabled = true wait(2)
script.Parent:TweenSize(UDim2.new(.3, 1, 1), "Out", "Linear", 2, true) wait(2) script.Parent:TweenSize(UDim2.new(.5, 1, 1), "Out", "Linear", 1, true) wait(3) script.Parent:TweenSize(UDim2.new(1, 1, 1), "Out", "Linear", 1, true) wait(1) script.Parent.Parent.Parent.Parent.Enabled = false wait(1) script.Parent:TweenSize(UDim2.new(0, 0, 0), "Out", "Linear", 1, true)
end
if screen == 2 then print '2' script.Parent.Parent.Parent.Parent.Enabled = true wait(2)
script.Parent:TweenSize(UDim2.new(.1, 1, 1), "Out", "Linear", 3, true) wait(1) script.Parent:TweenSize(UDim2.new(.4, 1, 1), "Out", "Linear", 2, true) wait(4) script.Parent:TweenSize(UDim2.new(.7, 1, 1), "Out", "Linear", 3, true) wait(1) script.Parent:TweenSize(UDim2.new(1, 1, 1), "Out", "Linear", 1, true) wait(1) script.Parent.Parent.Parent.Parent.Enabled = false wait(1) script.Parent:TweenSize(UDim2.new(0, 0, 0), "Out", "Linear", 1, true)
end if screen == 3 then print '3' script.Parent.Parent.Parent.Parent.Enabled = true wait(2)
script.Parent:TweenSize(UDim2.new(.6, 1, 1), "Out", "Linear", 2, true) wait(2) script.Parent:TweenSize(UDim2.new(.8, 1, 1), "Out", "Linear", 3, true) wait(3) script.Parent:TweenSize(UDim2.new(1, 1, 1), "Out", "Linear", 1, true) wait(1) script.Parent.Parent.Parent.Parent.Enabled = false wait(1) script.Parent:TweenSize(UDim2.new(0, 0, 0), "Out", "Linear", 1, true)
end
script.Parent.Parent.Parent.Visible = false
The most simple way to do is is to make the screen gui bigger:
script.Parent.Size = Udim2.new(2,0,2,0)