How to access the control table of the function "require"?

Oh my bad, I wasn’t sure what you were referring to. This is a fairly well documented issue.

The work around is to just launch a testing session of the game, or delete the ModuleScript and re-create it. Another approach is to convert the module into a constructor function which returns an object that inherits all of the module’s functions and properties.

local Module = {}

function Module.new()
	return setmetatable({}, {__index = Module})
end

return Module

Each call to Module.new() will return a new object that inherits the module script’s contents.

1 Like