GUI Not a vaild member of PlayerGui

I am trying to make a cutscene after the game loads, but for some reason, it won’t play cause there is something in the script that isn’t right. So I checked the output, and it’s saying image
And what I don’t get is that is is a member of PlayerGui, as you can see on the bottom of PlayerGui:
image

I’ve tried rewriting the script line and making it match the exact name

Here’s the line that keeps getting the error:
local firstFrame = script.Parent.Parent.WelcomeScreen.FirstFrame

I’ve had this problem before with other GUIs, and could never understand why it says it.

1 Like

I think it’s just a funny thing with how gui gets replicated from StarterGui to PlayerGui. One solution is WaitForChild

1 Like

Change it to:
local welcomeScreen = script.Parent.Parent:WaitForChild(“WelcomeScreen”)
local firstFrame = welcomeScreen:WaitForChild(“FirstFrame”)

3 Likes

You can just put wait(1) at the start of your script.

That fixed my problem! Thanks!