Why peaple using module script to m1/dash?

i really dont understand the point, pls explain why :no_mouth:

Because module scripts make everything more organized and simpler to see because else our eyes would need to be bleached because no one wants to see a long script that can be broken into pieces to make it more simpler and organised to read.

u can store functions in modules that are needed so u only need to call them in main script with one line instead of writing the function there (it makes it compact, and u can use it from different scripts)

Modules are pieces of code that you can reuse, that’s a simple way to put it.

Instead of having one singular Script for your entire game, you could have one, then split everything into modules for readability and organization.

Modules return something for scripts to use when we require them. Usually you’ll want it to be a table or function. This is because when you set a variable to them, Luau points it to the table/function rather than copying it. So you could, for example, use the same function across many scripts without the need to continuously copy/pasting it. And if you make any changes to that table/func, you just change it once.

the problem is that I don’t understand why they are in the scripts on desh, there are not too many repetitive actions

I’m having trouble understanding what u mean by repetitive actions.

I don’t know anyone who uses modules to make dashing, but m1s have many other features that might come into factor, for example, a parry based game like deepwoken, you need to check if a player is blocking dodging or rolling the m1s and the same for a bunch of other abilities

Hey! does this mean that you can use the same script for different scripts (local, server scripts)?

1 Like

Yes, that’s why they are useful lol.

also just a tip , … its preferred u store them in replicated storage so they dont get deleted and stuff

Heyyy! does this mean i can reset a combo just calling a function of module? like when u dash, combo reseting?

i mean ig … if thats what the function does

I used modules for m1 because I was lazy to create combat system for NPC so I just moved player combat script into module script and request it for player and NPC. Now player and NPC have the same combat system(Follow and distance checking system for combat is easy to do).