Can I detect when my module has been required from another (separate) piece of code?

enhancedError = function()
            function MetaManager:Error()
                local function getScript()
                    return 'placeholder'
                end
                
            end

            return MetaManager:Error()
        end

Take this (poorly) formatted code for example; when I call MetaManager:Error() I want to have the script from which my module is being required, returned. I’ve tried almost all of the tricks in the book, from messing with fenvs to desperately searching the forums for any sign of this.

If you don’t mind, leaving a reply below with a potential answer would be great, thanks.

:heart:

1 Like