I don't really know how to explain this well, but I'm trying to call a function with a table, but the function has parameters. Heres what I've got (ignore the names)
commands[table.find(commandNames,command)](params)
commands[table.find(commandNames,command)] gets the function it needs, and I can leave it on its own to call the function but when I try to add parameters, it breaks, and says "attempt to call a nil value"
Anybody know how to fix this?
Nevermind, found the issue. You can't put a number in a table of functions and expect it to call the function with that number as the index in the function
Correct way of doing it was instead of find the actual name of the function within that list which would instead look like
commands[commandNames[table.find(commandNames,command)]](params)