Problems with Variadic Functions

This is the code I am using to get two services. (I’m doing it specifically like this because it is going to be obfuscated in the future).

From what I can tell, I pass 2 arguments to the variadic function meaning the for loop inside it should run twice. However, it runs a third time for a parameter that I don’t know of, and I can’t figure out why.

image

This function is not called anywhere else in this script. Does anyone know why the for loop is running 3 times instead of 2 resulting in the error being thrown?

Don’t use table.pack, as it will add one more value, the number of items in the table.
Do this.
local given = {...}

1 Like