Or statement: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>SoulStealer9875
New page: The or statement comes in handy when you want to check one of the listed values is a certain value. <pre> soul = true food = false try = false if soul == true or food == true or try == t...
>Flurite
Redirecting to Or operator
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The or statement comes in handy when you want to check one of the listed values is a certain value.
#REDIRECT[[Or operator]]
 
The or statement comes in handy when you want to check if one of the listed values is a certain value.


<pre>
<pre>
Line 6: Line 8:
try = false
try = false


if soul == true or food == true or try == true then
if soul == true or food == true or try == true then -- If any of the three comparisons are met, then continue with the code block
     print 'soul is always true'
     print 'soul is always true'
end
end
> soul is always true
</pre>
</pre>

Latest revision as of 19:08, 9 July 2011

Redirect to:

The or statement comes in handy when you want to check if one of the listed values is a certain value.

soul = true
food = false
try = false

if soul == true or food == true or try == true then -- If any of the three comparisons are met, then continue with the code block
    print 'soul is always true'
end


> soul is always true