if game.Workspace.AmountOfOrbs.Value = 3 then
print("Hello")
end
--AmountOfOrbs is a string value btw--
✓ ANSWER ACCEPTED
Why do I get an error message when I use '= 3'? Can someone explain why?
1 answer
✓ Accepted answer
You're using a single equal sign =, which can be used to set variables but cannot be used to compare values.
You need an operator to compare values, a double equal sign == is what you're looking for.
if game.Workspace.AmountOfOrbs.Value == 3 then
print("Hello")
end
2 comments
0
that makes so much sense, thanks for your help
0
= is an operator
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
= is the assignment operator. You mean to use ==, the equality operator