I did this but the color doenst change only to black and white?
01 | local playing = false |
02 |
03 |
04 | local function Error() |
05 | if playing = = false then |
06 | playing = true |
07 | local label = script.Parent |
08 | label.BackgroundColor 3 = (Color 3. new( 0 , 0 , 0 )) |
09 | wait( 0.5 ) |
10 | label.BackgroundColor 3 = (Color 3. new( 255 , 1 , 5 )) |
11 | wait( 0.5 ) |
12 | label.BackgroundColor 3 = (Color 3. new( 0 , 0 , 0 )) |
13 | wait( 0.5 ) |
14 | label.BackgroundColor 3 = (Color 3. new( 255 , 1 , 5 )) |
15 | wait( 0.5 ) |
Color3 isn't like RGB, instead of ranging from 0-255 it ranges from 0-1.
There are 2 ways to fix this, the easier one being using Color3.fromRGB instead of Color3.new:
1 | Color 3. fromRGB( 255 , 1 , 5 ) |
or you can divide every number by 255, so it's always a number between 0 and 1:
1 | Color 3. new( 255 / 255 , 1 / 255 , 5 / 255 ) |
Try this, if you need a different color just change the white or red to whatever the colors name is.
01 | local playing = false |
02 |
03 |
04 | local function Error() |
05 | if playing = = false then |
06 | playing = true |
07 | local label = script.Parent |
08 | label.BrickColor = BrickColor.White() |
09 | wait( 0.5 ) |
10 | label.BrickColor = BrickColor.Red() |
11 | wait( 0.5 ) |
12 | label.BrickColor = BrickColor.White() |
13 | wait( 0.5 ) |
14 | label.BrickColor = BrickColor.Red() |
15 | wait( 0.5 ) |