Originally Posted by Krainz
Hi, I'm having trouble understanding the logic within 'if not' and 'and' in the same statement.
Does that mean 'if not' AND 'if and not' or 'if not' AND 'if true'?
|
You can test it in the Live demo too
http://www.lua.org/cgi-bin/demo
Basically what MunkDev already described
Lua Code:
if not IsMouselooking() and GetMouseFocus() == WorldFrame then
self.x = x
self.y = y
end
Lua Code:
not false and false -- false
not true and false -- false
not false and true -- true
not true and true -- false
Truth table:
not x and
y
Code:
x | ¬ x ∧ y
false | true false → false
true | false false → false
false | true true → true
true | false true → false