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

Make Script check more than one value?

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?

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.