Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How can I test for a brick colour?

Asked by 5 years ago

I have a computer that when you complete an objective, it’s screen turns green. However, I want the colour of a projector to equal the computer’s colour.

Would this Sudo code work?

MatchingColour = Computer.BrickColour

Projector.BrickColour = MatchingColour

0
Use Enums. User#25115 0 — 5y
0
if Brick.BrickColor == Enum.Brickcolor.ColorYouWant then do whatever. Stephenthefox 94 — 5y
0
^ Something like that. User#25115 0 — 5y
0
why not just compare it with `BrickColor.new()`?? Gey4Jesus69 2705 — 5y
View all comments (5 more)
0
You could also just use the Color3, I just use Projector.Color3 = Color3.fromRGB(Computer.Color3) Cvieyra2test 176 — 5y
0
I absolutely dislike brickcolor Cvieyra2test 176 — 5y
0
Also, fellow non-American I see with "ColoUr" xDD Cvieyra2test 176 — 5y
0
The reason this doesn't work is cause you said "BrickColur" should you should have used BrickColor. namespace25 594 — 5y
0
Use BrickColor as british word "Colour" does not work in lua LoganboyInCO 150 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

that will work if you replace BrickColour with BrickColor, but i would recommend using just Color, because you can use any color in the spectrum with Color, not just the BrickColors

Projector.Color = Computer.Color

if you want to set some Parts Color with RGB, then use

Computer.Color = Color3.fromRGB(red value,green value,blue value)
Ad

Answer this question