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

How to access PlayerGui for a server script?

Asked by
JoneXI 51
4 years ago

Can you access PlayerGui from server script? If yes, how?

I always get this: ScreenGui is not a valid member of PlayerGui

0
Server scripts can't access the descendants of PlayerGui because of FilteringEnabled, so the answer is no DeceptiveCaster 3761 — 4y
0
Thank you. JoneXI 51 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Quick answer: No, you cannot access the PlayerGui from a server script.

But don't lose hope, you can use the server script to ask a local script to do what you want.

You can do this using RemoteEvents and RemoteFunctions. (https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events)

The idea is that the server script triggers a remoteEvent that the local script is listening for. Once the local script sees that the remoteEvent has been triggered, the local script performs an action with arguments passed through the remoteEvent.

I can't provide any further help without knowing specifics. If you want more info on how to use these, feel free to message me. Good luck with your game.

0
I was just looking at it before I red your answer :d Thank you. JoneXI 51 — 4y
Ad

Answer this question