I use FE and want server to invoke the client in order for the client to interact with a GUI, I prefer to put the LocalScript in ReplicatedStorage for neatness but it seems the client never gets invoked unless I put the LocalScript in StarterGui. Is this "okay" practice?
ReplicatedStorage
does not run scripts. It's called -Storage
for a reason.
There are really only five places where LocalScript
s can run:
It is obvious when you want to put a script in 1 and 5. But what about 2, 3, and 4? Here are some good rules of thumb:
For 2, put the LocalScript in the Character if a) You're manipulating the character itself and b) You expect the script to run again every time the player respawns.
For 3, put the LocalScript in PlayerGui if it manipulates the player's Gui.
For 4, put the LocalScript in PlayerScripts if you don't want it to reset whenever the player dies.
Because in your question, you're expecting the LocalScript to interact with the player's GUI, I would put it in the GUI.
tl;dr Yes, you can put it in StarterGui