je viens de trouver ça
-- creates a deep copy of a
-- table and all its properties
function deep_copy(obj)
if (type(obj)~="table") return obj
local cpy={}
setmetatable(cpy,getmetatable(obj))
for k,v in pairs(obj) do
cpy[k]=deep_copy(v)
end
return cpy
end