-- Your script name yourscript = {} -- Local table - other scripts don't see this, will contain our methods (object functions) local n = {} -- msg method (obj:msg()) -- self is "obj" function z:msg () _Msg(self.name.." says hello!") end -- Function to create objects function yourscript.new (name) local o = {} o.name = name -- You can ignore this stuff - it works local mt = {} mt.__index = m setmetatable(o, mt) end -- Example: obj = yourscript.new("Anders") obj:msg() -- Will print "Anders says hello" in console