"ScreenGui is not a valid member of PlayerGui" error, even though it seems like it IS valid

The output says that ScreenGui is not a valid member of PlayerGui (line 17, I even typed the path to the file without any use of local variables that I have…), but I swer it seems like it is valid. I am kind of doubting my sanity right now. I guess I am missing something very simple?

Try adding a :WaitForChild() function for the button you are trying to find, as it might not have loaded yet.
Like this:

local ChangeTeamButton = PlayerGui:WaitForChild("ScreenGui"):WaitForChild("PickTeam"):WaitForChild("ChangeTeamButton")
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.