Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function copyTable(...)
- local tArgs={...}
- local rtrn = {}
- local tbl = tArgs[1]
- if not type(tbl) == "table" then
- error("Argument 1 must be a table!")
- end
- local copied = tArgs[2] or {}
- for k, v in pairs(tArgs[1]) do
- if copied[tostring(k)] == nil then
- if type(tbl[k]) == "table" then
- copied[tostring(k)] = true
- rtrn[k] = copyTable(tbl[k], copied)
- else
- rtrn[k] = v
- copied[tostring(k)] = true
- end
- end
- end
- return rtrn
- end
- _G.myENV = copyTable(_ENV)
- _G.myENV.fs.copy = function() error(true) end
- _G.myENV.fs.copy()
Advertisement
Add Comment
Please, Sign In to add comment