This is merely an example, asking if this is even right. I see the wiki one but am wondering if this works. Also, I'm currently on mobile. No, this isn't productive. It's an EXAMPLE.
-- module script published, named mainmodule
print("clicked")
return -- ???
-- script
script.Parent.MouseButton1Click:connect(function()
require(mainmodule)
end
If this isn't correct, is this?
-- module script published, named mainmodule
script.Parent.MouseButton1Click:connect(function()
print("hai")
end
return
--script
require(mainmodule)

3 comments
Is there any solution to make it run more than once on demand, by clicking it?I need a way to protect my script, or maybe I just did not understand your last paragraph or two. I would appreciate it if you could rephrase.
It runs 'on demand'by calling the returned function. For instance, the last example will 'speak' each time the part is touched
What is the point of line 3 & 4?