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 the game fade in from white?

So, in a nutshell, when the game launches, it would look completely white, using an ImageLabel in a ScreenGUI. Then, I'd like it to wait for four seconds, then have it slowly fade into the game, setting the BackgroundTransparency to 1.

So how would I go about doing this? I'm quite new to coding, so I may not understand certain things. :/

1 comment

0

The best way to accomplish this is to use a for loop: http://wiki.roblox.com/index.php?title=Loops#For

3 answers

you would

for i,10 do--does it 10 times
whateveryoucalledit.Transparency = suchandusch.Transparency-0.1--takes off 0.1 each time
end

or

repeat
such.Transparency = such.Transparency-0.1
until such.Transparency = 0

1 comment

0

Neither work. What that's doing is making the white gui appear, not dissappear. And even if I make it so it adds on, neither work. Any other suggestions? :/

Use a for loop:

for i = 0,1,0.1 do
wait(0.1)
Background.Transparency = i
end

1 comment

0

This isn't working either. :( What kind of script should it be, and where abouts do I put it?

Here is the code I am using:

-- Makes game fade in from white

game.StarterGui.fadeWhite.ImageLabel.BackgroundTransparency = 0 --I have it set to 1 to see the game in studio, then this changes it to 0 to make it white when the game runs.
wait(4) --Waits for four seconds for the music to start.
for i = 0,1, 0.1 do
	wait(0.1)
	game.StarterGui.fadeWhite.ImageLabel.BackgroundTransparency = i
end

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