Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. getfenv = getfenv or function(f)
  2. f = (type(f) == 'function' and f or debug.getinfo(f + 1, 'f').func)
  3. local name, val
  4. local up = 0
  5. repeat
  6. up = up + 1
  7. name, val = debug.getupvalue(f, up)
  8. until name == '_ENV' or name == nil
  9. return val
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement