Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What do i do???

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

here is my script

if players.TeamColor = BrickColor.new("Medium blue") then

end

It is underlined the = and saying Expected then got = How do I fix this??

0
+1 mine User#5978 25 — 9y
0
+1 mine on the previous answer about the scrambler i worked pretty hard User#5978 25 — 9y

2 answers

Log in to vote
1
Answered by 9 years ago

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:

if players.TeamColor == BrickColor.new("Medium Blue") then
    print('Color matches')
end
0
Nice explanation Shawnyg 4330 — 9y
0
Thanks. CodingEvolution 490 — 9y
Ad
Log in to vote
-1
Answered by 9 years ago
if players.TeamColor == BrickColor.new("Medium Blue") then

end

Answer this question