✓ Accepted answer
You've got two errors in your script. The first one is that you are using or in the wrong place. In an if statement, you need else if you want to do something if the condition of the if statement isn't true.
Secondly, you only need one equals sign on line 6. One equals sign = is for assigning values and two equals signs == is for comparing values, such as your condition in line 3.
Your script should look like this when you fix both of these errors:
local ChangePart = game.Workspace.Part
if ChangePart.BrickColor == BrickColor.Red() then
ChangePart.BrickColor = BrickColor.Yellow()
else
ChangePart.BrickColor = BrickColor.Green()
end
I hope this helped you. If my answer helped, be sure to accept it. :)
Link for conditional statements.
Link for the list of operators you can use.
1 comment
I see that error and another one on line 5. Or should be else.