How should I be separating large code?

Wasn’t too sure where I’m supposed to ask a question like this because I’m not really asking any existing code to be reviewed, and more just a general question on how I should be organizing my code. Currently I have one local script that’s about 400 lines. Is this normal? Is it likely this code should be spread across several different scripts? If so how do you even do that? Modules? The reason I ask is because I found out that having one function using task.wait() apparently stalls the entire code? It seems to break my collision detection when I have an unrelated function using it. (by break I mean make it slightly less reliable)

It really depends on you and your team’s workflow. This bit of documentation might help you understand the different types of script architecture.

Personally I typically have one script on the client and server that initialize modules for a systemic codebase. I find that it’s more organized. Roblox often pushes multi-script architecture but, personally I’m not a fan. I find it messy!

Thanks I usually start sticking scripts all over the place and it gets really really messy and tedious

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.