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

Server-Side Script Not Finding GUI in a Player's GUI?

Asked by 5 years ago

So, I think this might be an issue with core roblox and thus I haven't provided any script.

My server-side script couldn't find a ScreenGui by the name of "Message" in a player's GUI. So I changed the GUI's name constantly to see if it was because of something else, to no result.

So, out of desperation, I make the script print out all of the PlayerGui's children. When it prints it, it prints only one of the 2-more GUI I can clearly see in the Explorer Window. (Prints "Freecam" without printing "Mes" (my GUI) and other GUI's that may occasionally pop up in the PlayerGui).

My GUI is placed in StarterGui. So, I am assuming the GUI Placement is determined by a localscript on the Core Roblox side, so this may be a FilteringEnabled kind of issue.

This however, is not the first time I've had issues with PlayerGui. A while back, any script I wrote, couldn't find "PlayerGui" inside a player via "player:FindFirstChild("PlayerGui")" so I figured out on my own that I could do "player:FindFirstChildOfClass("PlayerGui") and that worked.

Before you say the PlayerGui isn't being found, it is being found and it is definite that it is being found if I can run :GetChildren() on it...

Whilst writing this, I assume I could just create a server-side script that creates the gui into a player's GUI if it's a local-side issue.

0
Maybe you should try using :WaitForChild() instead of FindFirstChildOfClass("PlayerGui"). sonysunny 36 — 5y
0
because things are cloned into the player's player gui locally theking48989987 2147 — 5y

1 answer

Log in to vote
1
Answered by
Miniller 562 Moderation Voter
5 years ago
Edited 5 years ago

As theking48989987 wrote, that's because a LocalScript cloned the stuff to the Player's PlayerGui. Use (e.g) a RemoteEvent, fire it from a LocalScript, and a server-side script (with remoteevent.OnServerEvent() function) should clone the GUI. Read about RemoteEvents here.

2
Had a feeling it was local. I resolved the issue myself later on by using a server-side script to copy it from ReplicatedStorage and paste it in the player's GUI. However I will accept answer. Cvieyra2test 176 — 5y
Ad

Answer this question