Sub number expected?

Hi, I have a function that normally works, but it wont work this time and the error has to do something with the string.sub(). Any help? Thanks.

Main.Script:48:

ModuleScript.add_new_key(NewKey,string.sub(v.Name,"Input_")[2])

Error:

Main.Script:48: invalid argument #2 to 'sub' (number expected, got string)

You last “Input_” where you are supposed to have an index number

1 Like

Ohh, my bad. I was supposed to use string.split() not sub.

1 Like