ModuleScript function isn't working

ModuleScript

local MasterModule = {}

--[[variables]]--
EffectModule = require(script.EffectModule)

MasterModule.TweenService = game:GetService("TweenService")
MasterModule.Lighting = game:GetService("Lighting")
MasterModule.Debris = game:GetService("Debris")
--[[functions]]--
MasterModule.Ree = function()
    print("RERERERERER")
end

return MasterModule

Script

MasterModule = require(game.Lighting.MasterModule) --the modulescript is also called MasterModule in the explorer

MasterModule.Ree()

and it isn’t working. It’s not printing anything. Help?

1 Like

Question


What is the script parented to?
Is it disabled?

I might have doubts of ModuleScripts functioning inside Lighting.


If all else does not apply to the problem, try this.

local MasterModule = require(game.Lighting.MasterModule)

This should work, your script is probably not running.

A script must be a descendant of workspace or ServerScriptService and also have disabled set the false.

After some discussion with the poster and some other developers, it was found that his EffectsModule was requiring the MasterModule in an infinite loop.

2 Likes