Would it be wise to have a tool run almost solely through a Module or Bindable/RemoteEvent?


Main Question [TL;DR]

Alright, my question is Would it be wise to have a tool run almost solely through a Module or a BindableEvent?


Explanation

Alright, I’ve recently started creating tools on my own, however I want to know if it’s possible and wise to use a Module to control say multiple tools at once. What I mean by this is, let’s say you have five people who have a sword and they all start attacking eachother, damaging and all… well lets say I want all of that to run through a module instead of the typical LocalScript or Server Script in the tool itself. However, they all get damaged properly and at the same time.
Is this possible?, I assume it is; however I’d like some outsiders point of a view on this.


Reasoning

  1. Exploiters: Obviously, exploiters can’t access the ServerScriptService or ServerStorage… if you have one module/script ran by a Bindable Event in ServerScriptService, the script could run without needing to worry about it getting stolen or edited. Although an Exploiters edits to a Server Script won’t do anything. it’s still worth keeping as much out of their hands as possible, with this they can still copy the entire code and then try to claim it as their own.

  2. Editing: If you make tools, then you’ve probably come across the tedious issue of a few items that have the exact same scripting, just different values for certain things… all the sudden all the tools stop working; an update broke these items or a coding error appeared. Instead of needing to edit all 2+ scripts to find this exact error, you could have them all run through a Module/Bindable Event and make edits/changes to that script and they changes apply to all of the modules.


2 Likes

Pretty odd question as it’s impossible to solely use module or bindable events as you still need a local or server script to execute those modules and bindable events.

Yeah it’s possible, usually it’s done using the CollectionService | Roblox Creator Documentation to execute code on each instance that gets created to do stuff with it. Personally I use the events there to detect when a model/vehicle gets added to workspace and then do stuff with the model and I definitely recommend this as it makes it easier to modify and edit the code in one centralized location.

Also on the topic of organization I recommend using a framework which promote this type of coding known as the single responsibility like aerogame framework or knit which utilizes a “service” so you can have something like a “weapon service” which manages all the weapon instances in your game to make life easier in the future as you know who does what which is key when making a large game.

1 Like