This is a script inside a ColorCorrection in lighting
01 | while true do |
02 | local color = math.random( 1 , 4 ) |
03 | if color = = 1 then |
04 | script.Parent.Brightness = - 0.05 |
05 | wait( 3 ) |
06 | print ( "1" ) |
07 | else |
08 | if color = = 2 then |
09 | script.Parent.Brightness = - 1 |
10 | wait( 0.2 ) |
11 | script.Parent.Brightness = - 0.05 |
12 | wait( 1 ) |
13 | print ( "2" ) |
14 | else |
15 |
To make the screen randomly flash black, not working, nothing in output not even printing
any idea as to what I did wrong? :p
First off, I edited it using 'elseif'. It is way more organized. Anyways, put this into ServerScriptService. Alos one more thing. You said you're making the lights flash black. If you're doing that you'll need to switch the '0.05's and '1's
01 | local loop = 1 |
02 | local lighting = script.Parent.Parent.Lighting |
03 |
04 | while loop = = 1 do |
05 | local color = math.random( 1 , 4 ) |
06 | if color = = 1 then |
07 | lighting.Brightness = 0.05 |
08 | wait( 3 ) |
09 | print ( "1" ) |
10 | elseif color = = 2 then |
11 | lighting.Brightness = 1 |
12 | wait( 0.2 ) |
13 | lighting.Brightness = 0.05 |
14 | wait( 1 ) |
15 | print ( "2" ) |
Your issue is, that you're not supporting us with the Output showing the error. Also, from what i've determined and understanding, you're not using your elseif
correctly.
Here is what I suggest:
01 | while true do |
02 | local color = math.random( 1 , 4 ) |
03 | if color = = 1 then |
04 | script.Parent.Brightness = - 0.05 |
05 | wait( 3 ) |
06 | print ( "1" ) |
07 | elseif color = = 2 then |
08 | script.Parent.Brightness = - 1 |
09 | wait( 0.2 ) |
10 | script.Parent.Brightness = - 0.05 |
11 | wait( 1 ) |
12 | print ( "2" ) |
13 | elseif color = = 3 then |
14 | script.Parent.Brightness = - 1 |
15 | wait( 0.2 ) |