So, I have two tables "trks" and "fabs". "trk" and "fab" are two possible values of a variable I have. If the variable is "trk" I want it to pull from the table "trks", and if it's "fab" I want it to pull from the table "fabs". I tried this, but it was invalid syntax, so I decided to ask y'all.
if hairColChosen > #[hairs[hairChosen] .. "s"] then --do the stuff end
You don't want to do that -- it would get really confusing (what if it was "game"
? what if it was a parameter to your function? etc. it get's messy, and slow)
Instead, you should be pulling from a table.
local choices = { trks = "hello", fabs = "goodbye", } local choice = "trks" print(choices[choice]) --> hello