Newproxy wiki example does not work

on the wiki page for basic functions, it says that this…

local a = newproxy() 
local mt = getmetatable(a) 
print( mt ~= nil )
mt.__index = {Name="Proxy"} 
print( a.Name )

should print “true” and “Proxy”, but for me it prints “false” and errors that mt is nil

2 Likes

You must use newproxy(true), not just newproxy(). It’s unintuitive and not documented on the Roblox wiki.

3 Likes

Moved this to Documentation Requests so IX team can improve newproxy documentation.

The Developer Hub page has been corrected - thanks for raising this:

https://www.robloxdev.com/articles/Built-in-Functions-and-Variables/Lua#newproxy

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.