I've seen them being used before, and when I try to make my own, it never works. How can I set up or make one?
✓ ANSWER ACCEPTED
How do you use ModuleScripts?
1 answer
✓ Accepted answer
Basically, a modulescript doesn't operate by itself. Think of it as a library. You must have a separate script(not modulescript) that utilizes it.
The way a modulescript works is interesting. Though I won't go into that, you should learn more about it. Just know that for every module script, you must a table that contains everything in the module script and return it.
Here's an example:
ModuleScript:
local lib = {}
function lib.sayHi()
print("Hi")
end
return lib
Script:
local myModule = require(workspace.ModuleScript)
myModule.sayHi()
Output:
Hi
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thanks, man! Now I'll beable to figure them out easier. ;)
A ModuleScript doesn't have to return a table.