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

How do I access the PlayerGui of a player that is NOT the LocalPlayer?

Asked by 5 years ago

Okay to break this down a bit more:

I'm trying to create a group invite system where the LocalPlayer sends an invite to a regular player in the server and a GUI pops up on the invited player's screen. They can either click accept or decline and right now, I'm just trying to create a MouseButton1Down function for when they click accept. I can't use a Local Script to code this because PlayerGui does not exist for any player except the LocalPlayer. I also can't seem to use a server script because you can't manipulate GUI's with just server scripts. I've tried to create a remote event where I define PlayerGui as a variable in a server script and then transfer that variable over to a Local Script where I can use that variable to manipulate the GUI, but none of that worked for me.

I feel like there is an easy solution to this but I can't quite grasp it.

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

You can access another player's Gui with this variable local playerGui = players.PlayerName:WaitForChild("PlayerGui"), though you can store another variable or make a function to automatically change the PlayerName inside the playerGui variable. But there might be another ways of accessing another player's Gui. So, who knows?

0
Actually the server nor the client can access the contents of PlayerGui. If you want to make it work, you would have to FireClient() to the specific player you want to activate the GUI. BlackOrange3343 2676 — 5y
0
ye, thanks for telling me. I just realized that, but back in the day; ServerScripts could replicate the playergui. NickAtNick 163 — 5y
Ad

Answer this question