Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

I'm confused at this simple code?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
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.

0
What's the parent of the script iSvenDerp 233 — 8y
0
Like I said before, StarterPack NAWESOME14 40 — 8y

1 answer

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
8 years ago

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.

0
Thanks so much NAWESOME14 40 — 8y
Ad

Answer this question