Advertisement
Bolodefchoco_LUAXML

[Script] lt Meta

Dec 3rd, 2016
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. --Creator: Bolodefchoco
  2. --Made in: 03/12/2016
  3. --Last update: 03/12/2016
  4. --[[ Notes:
  5.     Does:
  6.         Possibilita o uso de "variavel < "letra""
  7.         Contém bugs.
  8. ]]--
  9.  
  10.  
  11. local notTable = {}
  12. _G = setmetatable(_G,{
  13.     __index = function(list,index)
  14.         if notTable[index] then
  15.             return list[index][1]
  16.         else
  17.             return list[index]
  18.         end
  19.     end,
  20.     __newindex = function(list,index,value)
  21.         local v = value
  22.         if type(value) ~= "table" then
  23.             v = {v}
  24.             notTable[index] = true
  25.         end
  26.         rawset(list,index,setmetatable(v,{
  27.             __lt = function(n1,n2)
  28.                 if type(n1) == "string" then
  29.                     return n1:byte() < n2[1]
  30.                 else
  31.                     return n1[1] < n2:byte()
  32.                 end
  33.             end
  34.         }))
  35.     end
  36. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement