Is there a better way to use if to check more than one thing....?
Like: I do:
if string == "taco" or string == "pizza" or string == "duck" then
better way:
if string == ('taco'or'duck') then
or something similar?
There's not really a better way. However, if there are a ton of string you would like to check, you could loop through a table and return if the string matches any of the values stored in the table.
Example,
local strings = { "taco"; "cheese"; "men"; "women"; "happy"; "sad"; "pyrondon"; "is"; "weird" } function check(string) for i,v in pairs(strings) do if string == v then return true end end return false end if check("men") then print("Returns True") end
That would only really be practical if you have tons of strings you want to check.
Good Luck!