To receive multiple return values, use multiple assignment:
1 | local function getFirstThreeNumbers() |
5 | local first, second, third = getFirstThreeNumbers() |
Extra return results will be discarded:
1 | local function getFirstNumbers() |
5 | local first, second, third = getFirstNumbers() |
6 | local anotherFirst, anotherSecond, anotherThird, anotherFourth = getFirstNumbers() |
7 | local moreFirst = getFirstNumbers() |
Extra variables in multiple assignment will get nil
:
1 | local function getFirstNumbers() |
5 | local first, second, third, fourth, fifth, sixth = getFirstNumbers() |