Send Metatable from one module script to another

I know someone above suggested using inheritance, but maybe this approach would be better suited for what you’re trying to accomplish? If it’s not, you should elaborate on why the previous suggestions were not suitable for this task.

-- first module script

local parent = {}

function parent:new()
     local obj = {}

     setmetatable(obj, self)
     self.__index = self
 
     return obj
end

function parent:test()
     print("testing")
end

return parent

-- second module script

local child = require(pathToParent):new()

function child:new()
     local obj = {}

     setmetatable(obj, self)
     self.__index = self

     return obj
end

function child:test2()
     print("another test function")
end

return child

I mean there isn’t really anything more elaborate upon, it doesn’t work, why it doesn’t work, I personally couldn’t tell you.

Alright, after 12 gruesome days lol, I’ve established a solution. The variable you set the modules index to, send that to module 2.