Please, help me! I'm making a new game, and i made a script to change player Gui (LocalScript) so for me,
game.StarterGui.ScreenGui.something.Text = ...
didn't work. So i did
game.Players.LocalPlayer.PlayerGui.ScreenGui.something.Text = ...
of course I didn't make a script to change Text of "something" but that's just a similliar example. Well, the second one usually works. But sometimes it returns
ScreenGui is not a valid member of PlayerGui
error. Well, From what I know- it means that when the script was executed, then PlayerGui didn't have "screengui" inside it-yet. I guess it's because PlayerGui didn't fully load. Of course, in playtest it works all the time, because the player loads instantly with the server. But in the studio server test (in studio>test>local server start) the server loads first, and then the Player loads, so it may be because of this. Game script is a server script of course, while i used LocalScript just for GUI changing. Just in answer, do an example code on how to change exampletext's Text value to something (locally, not from server). Well, this way to make it works even if the Player loads later than the server does. Does anyone understand me?

3 comments
hello i hope you see this:
Well you forgot that does ScreenGui exists in the PlayerGui? Make sure you put the ScreenGui in the PlayerGui with a script, if not. The error will say that, it means you want to do something on PlayerGui but does not have a child named ScreenGui
I have fixed this, but thanks for help anyway!