Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does unpack not work for some tables while I,v loop works for all the tables?

Asked by 5 years ago
Edited by M39a9am3R 5 years ago

Module

local module = {B = false, ['GGG'] = 'My', S= 'GirlFriend', C = 'Just', x = 'Left', qw = 'Me'} 


return module

ServerScript

Mod = require(game.Workspace.ModuleScript)

while wait(1) do
    print(unpack(Mod))
end


Prints Nothing but when I do a I,v loop it perfectly prints everything

while wait(1) do
for I,v in pairs(Mod) do

print(I,v)

end

end
0
unpack only upacks the array part of a table. User#29813 0 — 5y
0
I mention that in my tutorial on tables here: https://forum.scriptinghelpers.org/topic/889/part-1-all-about-tables User#29813 0 — 5y

Answer this question