Efficiency for character added events

Is it more efficient to create a script in StarterCharacterScripts or to create a script in ServerScriptService with a PlayerAdded and CharacterAdded events?

They both have their own use cases. What are you trying to do?

Inserting a billboardgui into the player’s head when their character is added.

StarterCharacterScripts will not add a ton of events for each player that joins your server in it’s lifetime. Also, it’s much easier to do. (In my opinion)

Just insert a script into starterCharacterScripts, reference character with script.Parent

Both will work, however starterCharacterScripts is intended for this purpose.

When I make custom character effects (custom username or health billboardgui, custom sound, death effects, etc.) I just use one script inside of StarterCharacterScripts, and name it something like “CharacterSetup.” The reason I do this is because it is really easy to organize (since its inside the character), and when you encounter errors you only have to search through one primary script.

There’s no difference. Even if there is a difference, it’s negligible. What you do is up to preference. The server load is still the same and doesn’t change. Whether you choose A or B, doesn’t matter. You aren’t experiencing any changes in networking or efficiency.

ServerScriptService just means that you’re holding that one script accountable for all players, while one in StarterCharacterScripts means you’re localising the logic to the character that the script gets cloned into.

Personally, I’d recommend StarterCharacterScripts for a lot of things you’d originally want to do with PlayerAdded → CharacterAdded. The container just doesn’t get the love it deserves and I feel that I’ve taken a liking to allowing my localised logic to be put there. Preference.

1 Like