Hey, so I was just wondering, but am I able to make changes from the player’s PlayerGui from the server?
I remember having issues with this when I was new to Filtering, and honestly I can’t remember how I need to go about this.
Can always do a remote event here, but it’d be easier if I could just adjust it directly.
Thanks!
XAXA
(XAXA)
May 24, 2019, 10:50pm
#2
You could, but you really shouldn’t.
I could give just give you fixed code and be done with it, but the result would be that whatever project your working on becomes an incomprehensible mess.
When working with UI’s, as a general rule, any changes to a Players GUI’s should be made by the player themselves, the client, and not the server. To do this you need to use Remote Events and Remote functions, and to use them you need to understand what FilteringEnabled ‘Experimental Mode’ is and how it works. The wiki has plenty of articles …
As far as I know, the server can’t read the contents of PlayerGui at all – in fact, I don’t believe it can do anything except add GUIs into it.
Is there a reason you need to delete the server’s POV? Everything you need to modify it (and any reasons for doing so) should all be client-side.
To answer your actual question, what you’d do is use RemoteEvent:FireServer() on the client, and listen to RemoteEvent.OnServerEvent on the server.
Here’s an example:
-- Client
RemoteEvent:FireServer("Dele…
Network events should be declarative. All the server has to do is tell the clients what it saw happen. After that, the client can determine what that actually means when it comes to animations and effects and whatever.
In other words: The server is the referee and states what occurred without providing too much details. The clients are the orchestrators and they listen to the referee and handle all the details. It’s best to not mix these roles up.
For this reason, there’s probably no need for …
3 Likes
rogchamp
(pasta)
May 24, 2019, 11:06pm
#3
Anything automatically replicated by StarterGui will not exist by the server’s point of view, and any changes made by the client will not be present for the server. If you manually copy something from the server, you could edit it then, but it’s much simpler to just do it all on the client.
1 Like