There is completely no issue with what he recommended. This is completely why I recommended using table.find()
and honestly saves the hassle of referencing it. In fact that’s what I used in the first solution that you didn’t accept for absolutely no reason.
table[index] as you did and table.find(table, commandName) as I was suggesting would do the same thing
local Array = {
["c"] = "c"
}
Array["c"] -- = c so true
local Array2 = {"c"}
table.find(Array2, "c") -- = true
Both will return true in an if statement but the second one is more optimized because making a dictionary just to index a string when you can achieve the same by putting the string in a simple array is useless
It searches by index, not value. That would be the problem here, so does table.find().
No, table.find doesn’t search for index, it searches for value, which is why it is fine to do it with an array like this:
{'c', 'cmds'}
I noticed I the progress when testing around with table.find. I can definitely replace that part.
And, here’s what I came up with instead, which was my original idea around 5 hours ago.
if (FixedCommand == Index or FixedCommand == Value.Aliases[FixedCommand]) then
(Because table.find is a bit stubborn, I chose not to implement it, due to it not working.)