Error on a boolean expression

print(((“should not print” or false) and true) or false)
This prints “should not print”, but it should print true
It seems like I am not the first person to figure this out (Anamius told me it was a bug known for a while)

roblox staff fix it now

just do it

1 Like

Let’s break this down.

print(((“should not print” or false) and true) or false)

“should not print” or false –this is to be true since “should not print” is initialized and not null

so now we have this

print(((true) and true) or false)
which is the same as

print((true and true) or false)
Since (true and true) returns true, we can ignore false and print the initial message

Edit: nevermind I thought you were saying it shouldnt be true and im dumb

[quote]

Edit: nevermind I thought you were saying it shouldnt be true and im dumb [/quote]

claps for gollygreg

That’s a Lua bug:

http://www.lua.org/bugs.html#5.1.4-3
http://www.lua.org/bugs.html#5.1.4-9

Looks like upgrading to 5.1.5 may fix it.

[quote] That’s a Lua bug:

http://www.lua.org/bugs.html#5.1.4-3
http://www.lua.org/bugs.html#5.1.4-9

Looks like upgrading to 5.1.5 may fix it. [/quote]
Well only you guys can do that. I’ve heard that can add quite a few bugs to the game, why?

print((("should not print" or false) and true) or false)

A long awaited update, but this was fixed quite some time back.

2 Likes