Announcement

Collapse
No announcement yet.

Unable to use setmetatable on client side

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Unable to use setmetatable on client side

    Hello,

    When I try to set a metatable on the client side, I get this error in the console:

    Code:
    attempt to call a nil value (global 'setmetatable')

    #2
    Hi, it's disabled on the client for security. Use createtable_ex(table, metatable) to create a table with a custom metatable.

    Comment


      #3
      Originally posted by Talos View Post
      Hi, it's disabled on the client for security. Use createtable_ex(table, metatable) to create a table with a custom metatable.
      Thank you.

      I saw you updated the wiki.
      In your message you said that we could use as
      Code:
      createtable_ex(table, metatable)
      but on the wiki you use it as
      Code:
      local table = createtable_ex(metatable)
      Are both uses valid?


      I use this "hack" to make shared package but seems not working:
      Code:
      if not setmetatable then setmetatable = createtable_ex end
      Are MetatableEvents like __call available on table return by createtable_ex ?



      Also
      Code:
      getmetatable
      is not defined by the way. There is a workaround?
      Last edited by Deewarz; 12-17-2019, 10:55 PM.

      Comment


        #4
        The example on the wiki is correct.
        Can't add getmetatable or setmetatable for now because of security.

        Comment

        Working...
        X