Which is the best place to store your scripts?

I’m making a mini-game type game, and well… I have a lot of scripts.

I was wondering, what is that best way to store all this code.

Currently I’m having a main script. Then a different script for each minigame.
Is this better then just having it all in one script? I’ve gotten multiple different answers.
Let me know what you think!

2 Likes

For something simple like minigames I would have one main script in ServerScriptStorage to manage the rest of the game (currency, minigames, etc.)

Assuming you’re using a modular approach you could do something like this:

image

Edit Silly me forgot to expand the Minigames modulescript, but it pretty much just contained a bunch of other modulescripts that had the name of the minigame in question. Ideally these modules would contain the gameplay rules of the minigame.

2 Likes

Server storage is indeed very safe. However, I don’t know if scripts will run if they’re in there.
You can try it and see if it works. :slightly_smiling_face:

  • Server scripts should be placed in ServerScriptService.

  • Modules only needed by the server should be placed in ServerStorage.

  • Local scripts should be placed in StarterPlayerScripts, if they are made for something that has to do with character or humanoid of the player, place it in StarterCharacterScripts. If the script is for loading screens, or anything to do with while the game has not loaded, place it in ReplicatedFirst.

  • Modules that can be used by the server and the client should be placed in ReplicatedStorage.

11 Likes