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

How do you unpack a matrix?[Solved]

Asked by 4 years ago
Edited 4 years ago

The question is pretty simple but I can't do it so I use table.unpack for this but it doesn't seem to work so here is the program.

game.ServerScriptStorage.Statistics

local module = { -- this module is the module we are looking for
    data = {a=1,b=2,c=3},
    data2 = {a=4,b=5,c=6}

}
return module

there is also an empty module script in game.ServerScriptStorage.ModuleScript script

local Stats = require(game.ServerScriptStorage.Statistics)
local Container = game.ServerScriptStorage.ModuleScript:Clone()
local NewContainer = require(Container)
NewContainer = {table.unpack(Stats.data2)}
Container.Name = file
Container.Parent = game.Workspace

---the test

local tester = require(game.Workspace.file)
print(tester.a)--returns nil

How do I fix this? I want to make a completely new independent table for this.

0
i am pretty sure you can only unpack arrays? but i am not sure.. lemme test' User#23252 26 — 4y
0
yea, you can only unpack arrays.. i just tested. User#23252 26 — 4y
0
alright but is there any way you can do this? superbolt999 36 — 4y
1
copy the table, look into "deepcopy" for this kisty1 111 — 4y

Answer this question