I am trying to change a Gui in a certain part of a main game script and I was trying to use PlayerGUI with the variable game.Players.LocalPlayer.PlayerGUI but I am getting an error saying LocalPlayer is a nil value. How should I access this?
COMMUNITY QUESTION
How do I access the playerGui from a server script?
2 answers
PlayerGui isn't accessible from a server script if FilteringEnabled is on. You could use a remote event to communicate with a local script, which can then access the Player Gui. Wiki article on remote events here.
Hope that helped
Im guessing that you have Filtering Enabled. With Filtering Enabled the GUI must be 100% Client Sided or it will not function properly. Server Script cannot access the player GUI unless you use Remote Events/Remote Function/Other tricks that I dont know about. Other than that there is almost no way to communicate with the GUI from the Server.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
HI GUYS
This is incorrect information. PlayerGui IS accessible. The issue was that he used game.Players.LocalPlayer.PlayerGui, but you cannot GET the LocalPlayer from a Script. Of course you can access the PlayerGui perfectly fine through a server script.