Script Structure and Communication Advice

Yes I know, I accidentally created two posts

My goal is to create a helicopter in Roblox that monitors and processes data in a realistic manner, providing maximum flexibility and immersion when flying.

I am looking for solutions and advice on how to setup the basic structure of my scripts. Attatched is my current outline of how the modules should be setup for maximum script efficiency.

Should I setup the seperate modules as module scripts, local, or normal scripts?

How should they communicate? Via Remote Functions/Events or via module script communication? Is it possible to store the data such as RPM, TEMP, and basic logic such as ON/OFF in the main script or should it be in an object value?

Keep in mind I am a mid scripter at best, I mostly edit scripts over actually making them. However, I’m hoping this project will help me learn all the in and outs of scripting.

1 Like

Consider OOP composition based programming.

Similar to your diagram, one main script and many components into it. You will find that even the components require information from other components which is solved by passing the variables from component → main module scripy → component

Also consider ECS:

Example structure with systems and components:

For cross server there will basically have to need two versions server and client.

The advantage of both ECS and OOP composition is that you can share the components between server and client if needed, or create server only ones and such.

Also even consider Knit framework which also provides a way to handle script to script communication good for learning which I have used in the past.

However I found that using it with ECS is not necessary as you will end up creating your own framework that you understand best.