Advertisement
Guest User

Untitled

a guest
Sep 5th, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. function installg (installto)
  2.     for k, v in _G.next, _G, nil do
  3.         installto[k] = v
  4.     end
  5.     installto._G = installto
  6. end
  7.  
  8. function create_loaded_metatable (getSelfID)
  9.     return  {   __index = function (t, k)
  10.                     local selfID = getSelfID()
  11.                     if not rawget (t, selfID) then
  12.                         rawset (t, selfID, {})
  13.                     end
  14.                     return rawget (t, selfID)[k]
  15.                 end,
  16.                 __newindex = function (t, k, v)
  17.                     local selfID = getSelfID()
  18.                     if not rawget (t, selfID) then
  19.                         rawset (t, selfID, {})
  20.                     end
  21.                    rawget (t, selfID)[k] = v
  22.                 end
  23.             }
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement