To start off, I know what’s Client and Server. I have tested Serverscript with GUI and it works. For example, when to detect button clicks and create UIs for a Player’s PlayerGui it only works for them.
I’m asking this question because I want to know if there are any downsides to using Serverscript for GUI. Such as issues long term and security issues. Feel to free to comment them as well! Thanks.
i donot think its a good idea because the server sided script will get cloned for every player in the server and there will be alot of connections to the server + the client will get delay if you are handling gui on the server
i never tried server scripts in starter gui so not sure of that
Coincidentally, another person made a topic that’s very similar to this one 9 hours ago:
My response is also a valid answer for your question:
Only for simple things you don’t want players to interact with. Mainly billboard and surfaceguis that display basic stuff like those top 5 leaderboards you sometimes see in game lobbies.
If anything has a clickable button or takes any sort of input from a player, it should be done in PayerGui using a LocalScript.
Anything that needs to be handled server-side after the Gui receives info from some kind of input, that can be done using a RemoteEvent/RemoteFunction.
I would assume anything server side would be more secure but a bit less responsive.
One downside is unnecessarily taxing the server. UI should be handled on the client, because it doesn’t matter for other players. This means we can just let the client do all the computing. Also, it’d be slower due to latency.
UI is built for client, I mean that’s the reason there’s a StarterGui folder to replicate gui elements into the player and not the server. If you prioritise security over conveniency and smooth gameplay then go for the server, though I still recommend doing in on the client anyway since there isn’t much exploiters can do spamming a button as long as you change important values on the server only
If were talking about ScreenGui here then i would recommend using remote events (FireAllClients) instead of server scripts.
But other GUI types 100% work with server scripts.