How to check for certain brick colors for parts?

Hello! I was wondering how I can check if a BrickColor is something (Eg: if part.BrickColor == "Quill grey" then)

Checking for strings doesn’t work and there doesn’t seem to be any Enum.BrickColor. Any help would be much appriciated. Thanks!

2 Likes

If Part.BrickColor == BrickColor.red then
print(“Part color is red”);
end;

1 Like
if part.BrickColor==BrickColor.new("Quill grey") then 
2 Likes

Why did you put ; at the end of each line?

1 Like

It’s just personal preference (most of the time).

It essentially does nothing, it’s just a force or habit of mine, please ignore it!

But if you’ve found the answer to your problem, please select a solution.

Checking for strings doesn’t work and there doesn’t seem to be any Enum.BrickColor. Any help would be much appriciated. Thanks!

‘BrickColor’ values have a ‘Name’ property that you can index.

if Part.BrickColor.Name == "Quill grey" then

https://developer.roblox.com/en-us/api-reference/datatype/BrickColor