Is it possible to make an conditional statement check two or more things? Like I have 4 BoolValues, and I want the script to check if all the 4 values are true, how would I do that?
COMMUNITY QUESTION
Make Script check more than one value?
1 answer
Sure, just use the AND operator.
if boolValue1.Value and boolValue2.Value and boolValue3.Value and boolValue4.Value then
print("All true.");
end
Of course you can check if the value is == true, but when that is not supplied it just checks to make sure it's not false or nil. And a boolValue's Value can never be nil (or anything else for that matter) other than true or false.
This discussion is preserved as it was. New answers, comments, and votes are closed.
