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

I'm confused at this simple code?

H1=script.Parent.H1

Btw, this is in a local script, in StarterPack. There is a bool value in StarterPack named "H1". And this is what I get:

"01:54:52.716 - H1 is not a valid member of Backpack"

If you have any advice, I appreciate it.

2 comments

0

What's the parent of the script

0

Like I said before, StarterPack

1 answer

✓ Accepted answer

When it comes to the Character, PlayerGui, and Backpack, not everything loads at the same time.

The problem is likely that the LocalScript is placed in the backpack before the H1 BoolValue.

Use

H1 = script.Parent:WaitForChild("H1")

to get the object, but wait for it to appear if it's not yet there.

1 comment

0

Thanks so much

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