Optimization Question: Centralized Scripts vs Decentralized Scripts

Hello!
I’m wondering if there is a impact/difference if Multiple scripts were running on the server compared to just 1 - 3 main scripts being ran.

In addition, what is there also a different in RemoteEvents, and Functions in whether there were multiple events or just a few main ones?

Here are some pictures of my current setup: (Server Script Service)
image
(Replicated Storage)
image

To put Short, Should I condense my scripts into just 1-2 main scripts, ( Same with events )? Or is there no impact and it’s fine the way it is.

@ProfessorVaherus It really depends on the length of those scripts and how complex they are. In most of my work, I tend to organize my scripting into multiple scripts instead of one huge script. I would recommend that you do something similar. Generally, it would be best not to use a minimal amount of scripts. It will be easier for future programmers and yourself for organizing and figuring out where each script is. tl;dr Don’t use just one or two main scripts.

1 Like

It matters how it is coded and the amount of processing each and every script does. So, lets say you made a script that allows the npc to follow a near by humanoid and loops to update its coordinates. Two ways this could be done to allow every npc to have this feature. Either making 1 script that scans the workspace for the specified AI and execute the follow code using a function, or simply copy and pasting 1 follow script into every npc. Pretty much 1 optimized script vs 100 follow scripts will be a major difference in server performance.