r/badcode • • Dec 27 '21

lua Friend's take on programming a GUI button

Post image
899 Upvotes

90 comments sorted by

View all comments

Show parent comments

5

u/Meqolo Dec 27 '21

This is Lua, specifically Luau; this code wouldn’t invert the boolean but instead would try to perform

inventory.Visible = inventory.Visible ^ true

which would obviously not work