Hi. I have a function connected to MouseClick, which works outside of the module, but not inside of it. The rest of the module runs fine, but the connection doesn't fire. Can connection lines be used within ModuleScripts?
Example of what I mean:
Server Script:
local module = require(script.Parent.Module)
module.initialise()
Module:
local m = {}
function m.initialise()
-- Definition of ClickDetector, etc etc
click.MouseClick:connect(function()
print("I was clicked, or something")
end)
end
return m
I'd be able to do this easily without using the module, but it would be better if it could be contained in it. Thanks in advance!

2 comments
You need to require the module, so just change it to: local module = require(script.Parent.Module). That should fix it
I did in the actual script, typed this up as an example & forgot to require. Let me edit that in