Is there a way to turn a module into a metatable from outside said module?

I have a script that runs through every module within a folder and is trying to automatically make them inherit from their parent module. I want to essentially change the table of the module into a metatable with __index pointing towards their parent module, which itself could point towards another one… etc.
Is there a way I can do this without some janky workaround, like, setting it directly?

What I have

What I want the script to fill in automatically for me

For clarification, I want it to be filled in upon playing the game, and simply not be written in explicitly. If you want a module to inherit from another one, drag and drop it into another module and the game should take care of the rest for you. That kind of thing.

Sorry, I’m a bit of an idiot, had a loop set the module’s parent then proceeded to check for the parent later. Turns out you can just use setmetatable(requiredmodule, {__index = requiredmoduleparent}) and it’ll replicate just fine to the module.