if workspace.C.REDD.RED.BrickColor==BrickColor.new("Really red") or workspace.C.REDD.RED.BrickColor==BrickColor.new("Bright red")or workspace.C.REDD.RED.BrickColor==BrickColor.new("Persimmon") and workspace.C.BLUEE.BLUE.BrickColor==BrickColor.new("Really blue") or workspace.C.BLUEE.BLUE.BrickColor==BrickColor.new("Bright blue")or workspace.C.BLUEE.BLUE.BrickColor==BrickColor.new("Electric blue") and workspace.C.WHITEE.WHITE.BrickColor==BrickColor.new("Ghost grey") then Message=Instance.new("Message",workspace) Message.Text="YOU WIN!" wait(3) Message:Remove() end
C is the main parent, REDD is the child of C but the parent of RED. When I change the colors to what it's supposed to be the message that is supposed to appear does not show up.
The issue with your script is that you are trying to put everything on a single if statement. You tell it to check for three brickcolors, then you use and to check for the other colors. When you use the and, it only affects that specific statement after the and. The or that comes after is not connected to the and, making it a entirely different statement that can pass all the other ones. To fix it I would make if statements that check for each brick separately
01 | PartOneCorrect = false |
02 | PartTwoCorrect = false |
03 | PartThreeCorrect = false |
04 |
05 | if PartPath.BrickColor = = BrickColor.new( "Really red" ) or PartPath.BrickColor = = BrickColor.new( "Bright red" ) or PartPath.BrickColor = = BrickColor.new( "Persimmon" ) then |
06 | PartOneCorrect = true |
07 | end |
08 |
09 | if PartPath.BrickColor = = BrickColor.new( "Really blue" ) or PartPath.BrickColor = = BrickColor.new( "Bright blue" ) or PartPath.BrickColor = = BrickColor.new( "Electric blue" ) then |
10 | PartTwoCorrect = true |
11 | end |
12 |
13 | if PartPath.BrickColor = = BrickColor.new( "Ghost grey" ) then |
14 | PartThreeCorrect = true |
15 | end |
16 |
17 | if PartOneCorrect = = true and PartTwoCorrect = = true and PartThreeCorrect = = true then |
18 | --Run what code you want to run here |
19 | end |