Not working
Colors = {"Pearl", "Toothpaste"}
game.Workspace.aaa.BrickColor = BrickColor.new(math.random(1, #Colors))
Not working
Colors = {"Pearl", "Toothpaste"}
game.Workspace.aaa.BrickColor = BrickColor.new(math.random(1, #Colors))
#Why does it not work? You are setting the color of the brick to the value 1 to 2. It works fine, it's just that you're not actually using tables correctly. Everything works fine though.
#How do you fix it?
When using a table, you try to address a value inside like this Table[1]. Table being the table, and the number next to it being which value in the table to choose.
#Final Product
Colors = {"Pearl", "Toothpaste"}
game.Workspace.aaa.BrickColor = BrickColor.new(Colors[math.random(1, #Colors)]) --Very small change. Added: "Colors[...]"
Hope it helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.