A = game.workspace.Butt2 script.Parent.Touched:connect(function(Color) if A.BrickColor == "Medium Stone Grey" then print("Working") game.Workspace.Butt2.BrickColor = BrickColor.new("Really Red") elseif A.BrickColor == "Really Red" then A.BrickColor = BrickColor.new("Really Blue") elseif A.BrickColor == "Really Blue" then A.BrickColor = BrickColor.new("Really Red") end end)
My situation is I have this line of code inside a part, that is a button. I have another part a few studs away from the button. I just don't understand why it isn't working. I assumed that it might have been the fact that I stuck the code into an anonymous function, but It seemed to be that It didn't work, unless I failed to make a regular function as well.
Did I mess up on a line or something?
When checking to see if something is a BrickColor, you still need to use BrickColor.new()
, because BrickColor values are not strings.
Also, BrickColor values only have the first letter capitalised, like so:
BrickColor.new("Medium stone grey")