Search found 1 match

by NishiyamaPedro
Thu Sep 08, 2022 11:35 pm
Forum: Support and Development
Topic: "Unexpected Symbol near if" error
Replies: 4
Views: 3526

Re: "Unexpected Symbol near if" error

You can do it like this.

Code: Select all

local foo = true and "bar" or "hello world"
There are other ways to get the same result, if you are interested you can read here
http://lua-users.org/wiki/TernaryOperator