How to improve scripting workflow?

I’m interested in improving my overall code quality. I think I’m very familiar with Lua in general, and a lot of Roblox APIs and classes they provide in Studio.

With that said, depending on what I’m doing, things can get messy. Not necessarily inefficient, just messy. Like, most of the client code being in one place. More recently for a project, I’ve been trying to group different frameworks as their own modules. e.g: the daily rewards system gets its own module containing information for that system. Constants, some functions that handle generating the reward, and so fourth.

I am deeply curious how I could really take my code to the next level. I guess a few direct questions I have would be the following:

  • How do you know when you should start writing another script? Whether that being a server-sided or locally-ran one.

  • Are there any topics I could check out that cover this idea of improved workflow/organization? I tried checking this out before, but I couldn’t find anything relative to my case.

Thanks! :slight_smile:

side note: If this better fits in Code Review or Discussion, let me know

Having most of your code in one place isn’t too bad, as long as you organize them in modules.

How I like to know if I need a new module is if the code does something not quite fitting in the current context. To elaborate, I have a main code for the game. The game script(a script, the only script in the game, the rest are modules) is a script that creates things and executes other modules to kickstart the game. The modules, in this case the PlayerHandler and the ObjectModules are sub categories that have different functions. For context:


The building modules are controlled by the game script(when that object is added, the module script would do something). Everything else is self explanatory. The CharacterSetup does anything with the character(Carmin and Jale are custom characters, Effects are character effects, etc).

1 Like