Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What do i do???

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??

2 comments

0

+1 mine

0

+1 mine on the previous answer about the scrambler i worked pretty hard

2 answers

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

2 comments

0

Nice explanation

0

Thanks.

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

end

This discussion is preserved as it was. New answers, comments, and votes are closed.