Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make an if statement for a BrickColor property?

I want to be able to run a code, when a certain part has the BrickColor called "Hot pink". How would I change the script below in order to do that?

if script.Parent.BrickColor == "Hot pink" then
--[piece of code]
end

1 answer

✓ Accepted answer

BrickColor is not a string, you have to compare it to BrickColor.new("Hot pink")

if script.Parent.BrickColor == BrickColor.new("Hot pink") then
	-- Code
end

If my answer solved your problem please don't forget to accept it.

1 comment

0

It worked. Thank you very much for answering so fast.

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