Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I access the playerGui from a server script?

Asked by 6 years ago

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?

2 answers

Log in to vote
1
Answered by 6 years ago

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

0
HI GUYS User#19524 175 — 6y
0
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. Nowaha 459 — 5y
Ad
Log in to vote
-1
Answered by 6 years ago

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.

Answer this question