Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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.

2 comments

0

Maybe you should try using :WaitForChild() instead of FindFirstChildOfClass("PlayerGui").

0

because things are cloned into the player's player gui locally

1 answer

✓ Accepted answer

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.

1 comment

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.