here is my script
1 | if players.TeamColor = BrickColor.new( "Medium blue" ) then |
2 |
3 | end |
It is underlined the = and saying Expected then got = How do I fix this??
Well, there are two symbols we need to identify here:
==
and
=
Now, the "=" symbol is used when creating a new index (i.e, giving something a value). The "==" symbol is used when we're comparing two values. The "==" symbol will always either return true, or false.
So, in your example, we'd use "==" strictly because we're trying to compare a team color to a brick color. It's very important that you read the "==" symbol as "is equal to".
Our final product:
1 | if players.TeamColor = = BrickColor.new( "Medium Blue" ) then |
2 | print ( 'Color matches' ) |
3 | end |
1 | if players.TeamColor = = BrickColor.new( "Medium Blue" ) then |
2 |
3 | end |