of     1   

Firebrand1
#149951248Monday, November 17, 2014 6:41 PM GMT

I'm quite interested in learning to use Module scripts to clean up my code. However, I'm a bit confused as to how they work and the tutorials/blog post don't explain it sufficiently. I'm wondering how I can have a module script run using the data from the specific script that is calling require() For example, if a monster is 30 studs away, and I want the code to run if it is less than 40 studs away, how can I have the module script access these two values? Should I just put value instances as the module script's children and have it check those?
anaIyze
#149951317Monday, November 17, 2014 6:44 PM GMT

Make a function within the module's table, like: Module.Delete(part); -- would delete a part Also, if you havn't noticed the require(); method is the same as if you were using C# or C++, or any other languages that has the same functionality, it lets you access your functions instead of putting it all in one script (code).

    of     1