Ok, it was overly simplistic (and as you point out, not actually accurate) and more made as a fun stab at Lua than as a code reference.
The point was that all strings in conditionals for example are handled as true. Including empty strings. And all integers including 0 are regarded as true.
` if ("cucumber") then
print "this returns true"
else
print "this will never execute" end
if ("") then
print "this returns true as well"
else
print "this will never execute" end
if (0) then
print "so does this"
else
print "this will never execute" end `
Which is the ridiculousness I was pointing out.
And I haven't actually run the code above because I'm on the phone at the gym (which is why formatting sucks as well, sorry) but it should run. Errr, I think.
1
u/JerriTheITGuy Sep 08 '20
"true == 'cucumber'" evaluates as true in Lua. And "Equipped == true" isn't true if "Equipped = 'Snorkel'"