Instability while updating a player's Gui via Server

Always to avoid exploiters, I try to leave as much code as possible out of LocalScript.
Obviously, this isn’t possible for local things like input handling.
However, inside Server/PlayerAdded, I can intercept the Client’s Gui, like for example:

  1. For a specific player, set a frame as visible/invisible, by Server
  2. Modify a text from a TextLabel for this player, etc.

However, when testing by Studio’s MultiPlayer simulator, I notice that this technique is unstable.

As for other things that depend exclusively on the client, I use RemoteEvents commanded by the Server to be executed in the specific player’s LocalScript.

Everything is apparently logical and works… but not always… sometimes (sometimes) a frame doesn’t change to visible or invisible, sometimes the text of the client’s TextLabel (changed by Server) doesn’t appear in this client …

I think I will have to rewrite all my code related to Gui to leave EVERYTHING inside LocalScript…
But then there is the nightmare: exploiters…

So my final questions:

  1. Is it worth deal the player’s GUI through the Server?
  2. Is there any safe way to do this without instability?
  3. Or should I really let any Gui changes be done only by LocalScript?

GUI, Graphical user Interface is something that you should handle on the client completely.
It should not matter what the UI says or shows, what should matter is what the server knows and tells, meaning that handling UIs on the server because you are scared of exploits is a horrible practice and suggests refactoring your code to match “The client asks the server to do something, but the server decides whether or not the client is supposed to do that thing”.

GUI changes should all be done by LocalScripts, no matter what they are, you could request data from the server, the whole point is all visual based things are handled on the client.
The server is a machine as well, just like your computer and the “client”, but its performance is much lower and should be preserved for more important tasks.

1 Like

You can create BoolValue and made Server-Side Function. I didn’t tested this method but I Think it will work.

local players = game:GetService("Players")
local ID = 123

players.PlayerAdded:Connect(function(player)

	local value= Instance.new("BoolValue")
	value.Parent = player
	value.Name = "test"
	value.Value = false

if player.UserId == ID then
	value.Value = true
end
while wait() do
if value.Value == true then
	--copy gui from serverstorage or something else
	end
end