Is it okay to have a Client Script in StarterGUI?

Some scripters that i know personally. Absolutely DESPISE having a Client Script inside of StarterGUI?

What are your thoughts on this?

For me its a personal preference and i would like to know if its a bad practice and or causes performance decreases???

1 Like

I feel like I use Client scripts in mostly all of my StartGUI UI Sets. Now the reason for this, is so that you can get the local player = game.Players.LocalPlayer instead of having to do something like a Parent.Parent.Parent.Parent and so on. Now in some circumstances, you might want to use a Serverscript in a StarterGUI, so you can make changes and check changes on the server side. Thank you.

2 Likes

Yea don’t do this. For every player that joins a new server script gets created. Also, more connections are created for the same event that fires which isn’t good.

To reply to the post, client scripts in starterGUI is completely fine. I don’t see why there would be an issue because its still 1 script that runs code despite of its location (excluding server store and server scripter service)

2 Likes

StarterGUI - Runs every character load unless you make a ScreenGUI, set it’s ResetOnSpawn Variable to false, and putting the script in it. Then it’s once, forever. (CLASSIC)

StarterPack - Runs every time the player is spawned it. (CLASSIC)

StarterPlayerScripts - Same as StarterGUI, ran once per launch. However, it’s in a folder called “PlayerScripts” inside the player. It also can overwrite base scripts (NEW)

StarterCharacterScripts - Same as StarterPack, however, it always spawns in the player character and will overwrite base scripts. (NEW)

Classic and New are based on how it used to be and how their use case changed slightly

1 Like

Im not sure about client scripts, but atleast they’re not server scripts :face_vomiting:

1 Like

It’s perfectly acceptable to use either client-sided or server-sided scripts in StarterGui

As a matter of fact, LocalScripts are what I usually use, since it’s best for performance to let the client handle any cosmetic effects for GUIs, and allows the use of ContextActionService or UserInputService for stuff like stamina bars

1 Like

what i would do is have 1 client script inside of start player scripts and have multiple module scripts that allow you to manage different aspects of each ui. like shown here

image

3 Likes

its okay to add the client scripts in any place i prefer adding client scripts in Replicated Storage you can add it the place you like

1 Like