So, I have a system on the client that does some checks and fires a remote event depending on the move you performed. The checks are all the same, so the script is designed to be very abstract and basically have one function handle all the checks and then fire the remote event accordingly, nice and efficient/readable.
Now, I also have some checks to do on the server. They are, again, all the same for each move. I thought that maybe it would be best to have one remote event fire the server check, and then just call a specific function in that server script depending on what move triggered the universal remote event.
Here’s the problem: there’s a lot of moves, and that would be a lot of functions in one server script. What I was thinking was maybe putting each ability into it’s one script, and then, rather than call each function from that server script, I call a bindable event to each script. My only other idea is module scripts, where I make a function for the cooldown check there and then use it to check the cooldown whenever the remote event is called, and then the outcome of that cooldown check function determines if the rest of the ability function actually runs. My question is,
- Would bindable events be slower? I’d imagine it would be, but would it be negligibly slower, or not worth it?
- Should I just suck it up and put it all in that one big server script?
- Is the module script method I stated valid and/or a good idea?
- Are there better options I haven’t thought of?