I know I did everything right, but it isn't working.
while wait() do if game.Workspace.Loading.Value == true then script.Parent.DarkScreen.Visible = true repeat script.Parent.DarkScreen.BackgroundTransparency = script.Parent.DarkScreen.BackgroundTransparency -0.1 until script.Parent.DarkScreen.BackgroundTransparency <=0 script.Parent.GameLoad.Visible = true script.Parent.DarkScreen.Visible = false wait(12) script.Parent.GameLoad.Visible = false end end
It's simple. Your repeat is the problem. You need to add a wait to it.
Time = 3 --3 seconds. while wait() do if game.Workspace.Loading.Value == true then script.Parent.DarkScreen.Visible = true repeat script.Parent.DarkScreen.BackgroundTransparency = script.Parent.DarkScreen.BackgroundTransparency -0.1 wait(Time) until script.Parent.DarkScreen.BackgroundTransparency <=0 script.Parent.GameLoad.Visible = true script.Parent.DarkScreen.Visible = false wait(12) script.Parent.GameLoad.Visible = false end end
Alternatively, you can use for loops.
Time = 3 --3 seconds. while wait() do if game.Workspace.Loading.Value == true then script.Parent.DarkScreen.Visible = true for transparency = 1,0,-0.1 script.Parent.DarkScreen.BackgroundTransparency = transparency wait(Time) end script.Parent.GameLoad.Visible = true script.Parent.DarkScreen.Visible = false wait(12) script.Parent.GameLoad.Visible = false end end