How does table.unpack work

local yes = {2, 10, 5}
local yes1 = table.unpack(yes)

print(yes1)

Why does it only print the first value? Why do the other ones just disappear?

local yes1, yes2, yes3 = table.unpack(yes)
print( yes1, yes2, yes3)
1 Like

table.unpack() gives you all of the values like this value,value,value

for example

local tablelol = {1,5,1.3}
local number1,number2,number3 = table.unpack(tablelol)
print(number2)

Will print 5

Ohhhhh thanks i didn’t realise that

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.