Admin commands with more than one input?[SOLVED]

I am making an admin commands script. But unlike most admin commands scripts, it can only handle one input. For example I can do commands like ;kill player by doing string.sub(";kill player",7) and then getting the target player and killing it.

But how can I do commands with more than one input, like ;damage player 5? Because when I try to use the string.sub() it returns both player and the damage. How can I make the white space between the inputs separate them so the player name and the damage are treated like different words?

Any help is appreciated!

I found the solution myself. I can use string.split() to split the string into different “words”.