What does the "return module" do? I don't understand.
local module = {} function module.bro() print("I need help!") end return module
Let me explain this as best I can.
The first line of the script:
local module = {}
Creates a table called 'module'. Tables can hold anything. Integers, strings, functions, etc. When you do:
function module.bro() print("Help!") end
You're adding a function into the table 'module'. That function is called 'bro'. So, now you have a table and in that table you have a function. What next? Well, you need this:
return module
When you're trying to access a module script you do:
local a = require(game.Workspace.Module) a.bro()
That will print 'Help!'
When you require a module script it's actually running all the code inside of it. Here's the thing though, you're defining a table and putting a function inside and never calling it. So the only code that gets run is the return line. This just returns the table 'module' with any functions you may have defined. In this case the only function is 'bro'. That let's you access the table and everything in it Hope I helped :)