Local v1, v2, v3 = pairs() local v4 = v1(v2, v3) what does that mean?

one day I was just scripting when I stumbled across this phrase. What does that mean?

2 Likes

Looks like something an obfuscator would do to make the code as confusing as possible because there really isn’t any reason why someone would do this

Knowing this, v1 is the function next, v2 would be the table, and v3 would be nil.
The following statement is just calling the next function once on the table, and therefore returns the first element of the table

local v1, v2, v3 = pairs{1, 2, 3}
--v1 is next()
--v2 is {1, 2, 3}
--v3 is nil

local v4 = v1(v2, v3)
--same as: local v4 = next({1, 2, 3}, nil)
--v4 is 1

image

3 Likes

where did you find this? that’s from the synapse x decompiler output lol.

3 Likes

Uhhhhh… that looks like an exploit decompiler.

1 Like

It looks like the old Repl.it user interface lol.

1 Like

I used v1, v2 etc. as an example idk how to name it lol

1 Like

but yeah I indeed copied a short code from free model ToH shop

1 Like

It means that v1 is a function that takes two arguments, v2 and v3, and returns a value. v2 and v3 are the two values that are being passed into the function. v4 is the value that is being returned by the function.

2 Likes

this is what you find in a decompiler have you used a decompiler before