I messed with Lua yesterday and stumbled upon the newproxy function.
http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions#newproxy
I understand this, but I'm not sure how useful this is. I know that it creates an empty userdata object with an attached metathe (if the argument is true).
How useful is newproxy to it? Here is an example of what I did while messing with it:
local proxy = newproxy(true)
local metatable = getmetatable(proxy)
metatable.__index = function(array, key) print(array, key) end
local y = proxy[100]
--[[
OUTPUT:
userdata: 0x443ad4b4 100
]]
David source
share