A generic recursive table copy function:
Code:
function Copy_Table(src, dest)
for index, value in pairs(src) do
if type(value) == "table" then
dest[index] = {}
Copy_Table(value, dest[index])
else
dest[index] = value
end
end
end
Your destination can be a sub-table in another table.
Code:
ns.datamodules.DamageTaken = {}
Copy_Table(dt, ns.datamodules.DamageTaken)