FANDOM


UserdataEdit

EssentialsEdit

The userdata type is created only by the newproxy function. It is used to represent an object. Data is only able to be stored in its metatable.

SamplesEdit

Sample
The following is a sample of using a userdata.

Source:

local foo = newproxy(true)
getmetatable(foo)['__index'] = function(_, b)
       return ({Hello = 'World', Foo = 'Bar'})[b]
end
print(foo['Hello'])
Output:

World

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.