1

# How to call a random function within a table with parameters? [Solved]

Edited by greatneil80 18 days ago

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?

commands[commandNames[table.find(commandNames,command)]](params)