Script not being able to find a ui element under same parent

please keep in note that i am a HEAVY beginner, like, just started a week ago beginner, so im not gonna know everything. please excuse me if this issue was a very simple mistake

  1. What do you want to achieve? Keep it simple and clear!
    i want a screen to fade in using tweenservice (this part isnt important to the issue as far as im aware) and i need to connect the script and the ui using a local statement

  2. What is the issue? Include screenshots / videos if possible!
    it says that “msbackgrounds is not a valid member of playergui” even though it IS located in startergui (which, to my knowledge, transfers over to playergui)

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    ive tried changing the location of the frame and tried renaming the msbackgrounds, but nothing has worked. so far, i havent been able to word my problem properly, so i havent looked for solutions under the exact situation

attached are two photos of the problem, the script itself which is calling for the background/blackBG and the hierarchy in which it is located

Screenshot 2025-03-31 153353

msbackground might not be loaded yet when you’re trying to reference it
Replace the path to the msbackgrounds with script.Parent.Parent.Parent:WaitForChild('msbackgrounds') and see if that works

1 Like

i dont know how your actual coding experience reached this obscure little thread but IT WORKED!! THANK YOU!!