Optimal place to store local scripts

As the title says, I’ve been struggling to find a good container to place local scripts. Starter player/character wouldn’t be good since the local scripts are more general, such as replication or special effects. This problem is more of a organization problem.

1 Like

At this point I’d still go for StarterPlayerScripts. Nothing else comes to mind and I’ve been doing this to replicate special effects and other visuals (like door movement or bullet tracers) while the script(s) is/are located inside of PlayerScripts. Placing them inside of the PlayerGui for example would be the same as having it inside of SPS, though I’m guessing you are trying to avoid something simular as placing it into the Character.

In my opinion, I’d choose SPS. If you got any other ideas or some pros/cons on this, please say so.

2 Likes

What is that supposed to mean?

StarerPlayerScripts is a container for all local scripts, it runs once when the player joins.
StarerCharacterScripts scripts run each time the players character is loaded.
StarterGui runs each time the player gui loads unless ResetOnSpawn is false (for ScreenGui)and can store Gui elements.

1 Like

I meant like the scripts are not player related so it wouldn’t make sense for it to be there.

Regarding the latter, thanks for the insight.

It feels like it does matter what the purpose is of the script I am running. This is true for both local and server scripts. I put my scripts where I generally expect the objects they manipulate to be loaded. I’m definitely not a veteran at this, but I have seen numerous cases that require special consideration.

Examples:

Does it only manipulate a GUI? Put the script in the GUI.

Got map objects that won’t be loaded immediately? No point in running that script and waiting for an hour. Store the script in the object in ServerStorage. Use it later.

Got dialogue triggers? Throw the code in a module script, as a child of the dialogue, and require it when the trigger happens.

If the player needs it, it goes in the player and character scripts folder. If the player references it, it goes in ReplicatedStorage. If the player is not supposed to know about it, then it goes into ServerScriptService.

It’s not as disorganized as it sounds. I just don’t sort by object type.

2 Likes

I heard the optimal place is the workspace, don’t tell anyone though!

Maybe I didn’t make it clear, StarterPlayerScripts is not for scripts “about the player”, It’s for scripts that run when the player joins.

I don’t think I made it clear either, that’s what I thought before you said what each container does.