|
| 18 Dec 2015 02:54 AM |
function TtoU(t) local r=newproxy(true) getmetatable(r).__index=t getmetatable(r).__newindex=function(_,i,v)rawset(t,i,v) end getmetatable(r).__tostring=function()return tostring(t) end getmetatable(r).__metatable='' return r end
_G=TtoU(_G) print(type(_G)) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
| |
|
chimmmihc
|
  |
| Joined: 24 Jul 2014 |
| Total Posts: 2420 |
|
|
| 18 Dec 2015 05:58 AM |
| Ma user data I just a table of properties that description a object. |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2015 06:34 AM |
Oh noes! It didn't work! What's wrong???
local t = setmetatable({},{__add=function()return'hi'end})
t = TtoU(t) print(t+5)
IT ERRORRRRRRREDD
QQQQ HALPS MEH. |
|
|
| Report Abuse |
|
|