Advertisement
thatparadox

typeOf

Dec 12th, 2013
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.28 KB | None | 0 0
  1. var = read()
  2.     local _type = type(var);
  3.     if(_type ~= "table" and _type ~= "userdata") then
  4.         return _type;
  5.     end
  6.     local _meta = getmetatable(var);
  7.     if(_meta ~= nil and _meta._NAME ~= nil) then
  8.         return _meta._NAME;
  9.     else
  10.         return _type;
  11.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement