Take the 2-minute tour ×  Is there a way to execute a line of
code only if multiple statements are false?  I have an
inventory:  inventory = {     {"Images/Category 1/pistol1.png",
false},     {"Images/Category 1/machinePistol1.png", false},
{"Images/Category 2/shotgun1.png", false},     {"Images/Category
2/assaultRifle1.png", false},     {"Images/Category
3/sniperRifle1.png", false},     {"Images/Category
3/rocketLauncher1.png", false}  And I'd like to write a function
that executes a line of code if all those statements are false,
but obviously executes something else if even one of them is
true.  share|improve this question  1 Answer 1  up vote 5 down
vote accepted  You can use a variable, and assume it's true
local IsEverythingTrue = true  -- the **for** statement is a
loop. It will allow us to operate -- the same way on any number
elements in inventory. -- _,v stands for variables that we are
going to read from inventory table -- we can't do it directly,
however; **ipairs** function will prepare it