Is it better to have one connection in one script or multiple connections in multiple scripts?

Soo i wonder which solution is better, is having one script with let’s say playerAdded event and from here run all things in the game or is it better to have let’s say 5 scripts that have playerAdded event, but they also call only stuff that relate to them (e.g Script for inventory, script for rounds, script for guns ect.)

  • Multiple connections to the same event in multiple scripts
  • Only one connection to the same event in one script

0 voters

Assuming ModuleScripts are forbidden, you’d want to do it like this for the sake of organized code. But on the other hand, using ModuleScripts allows you to have a single connection that calls all the functions of the other scripts.

1 Like

hmmm yk, i use modules of course, but having more scripts and few more connections, let’s say in 6 different scripts is more organized and easier to do than adding 50 modules as variables and then calling them

There are no limits to how many connections to one event, but it is precarious if not handled well. If this choice has flaws that you do not want to maintain, maybe it’s time to change up the patterns a little.

1 Like