Code: Select all
if true then
something = 1
end
Code: Select all
something = 1
Code: Select all
if false then
something = 0
else
something = 1
end
Lua also uses a concept known as truthiness, which for Lua means that nil values will act as false in an if statement and numbers and strings act as true, so this is also the same:
Code: Select all
aValue = nil
if aValue then
something = 0
else
something = 1
end