CapsAdmin

Untitled

Dec 24th, 2011
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.26 KB | None | 0 0
  1. local NIL = {}
  2.  
  3. local function FALSE()
  4.     return false
  5. end
  6.  
  7. function NIL:__index(key)
  8.     if key:sub(0, 2) == "Is" then
  9.         return FALSE
  10.     end
  11.  
  12.     error(("tried to index %q on a nil value"):format(key), 2)
  13. end
  14.  
  15. debug.setmetatable(nil, NIL)
  16.  
  17. _R.NIL_META = NIL
Advertisement
Add Comment
Please, Sign In to add comment