Script can't locate object even though it's there

I put a boolvalue inside of starter pack. I put a local script inside of StarterPlayerScripts and located the backpack. I tried locating the boolvalue but it just won’t locate it.

print(backpack:WaitForChild("Playing").Value)

It keeps saying there is an infinite yield possible, and if I don’t put WaitForChild it says “Playing” is not a member of backpack, even after waiting a few seconds.

I’m confused because I did the exact same thing in another game and it worked.

Pretty sure starter pack can only hold local scripts and tools. You can check in your explorer in studio to see if it’s there or not.

1 Like

NVM, it does work, make sure the name is correct.

1 Like

If the name is correct, send the whole script so I can see.

1 Like

Yeah I checked the explorer and it’s there. I put it inside of StarterPlayer to fix this, but it’s weird because I’m pretty sure I put it in StarterPack before and it worked. Even though it’s not suppose to be in there, the script should of been able to locate it.

Also the name is correct. I made double sure by even copying and pasting the name.

OHHHH. Starter player is different than starter pack, things in starter pack go to the backpack

No I mean I just put the boolvalue in starter player after you left your comments to fix this, but before I did that is the problem.

1 Like

So its fixed? If so than good, and have a good day my friend.

1 Like

oh nevermind it’s not fixed. I thought for sure it was. Now I’m extra confused because I just went to one of my old games to double check, and turns out a bool value can go in starter pack and a script should be able to locate it. I used the exact same method, but for some reason it doesn’t work.

Send the full script and a screenshot of the explorer of the starter pack, if your on windows than you can use sniping tool(search in start menu) then you can just press snip to take a screen shot of a partial area on your screen then just ctrl v in dev fourm.

Sure. While editing:

And in the game:

image

image

Idk why but try to remove the .Value and see if it prints anything or if the warning still persists.

Removing the .Value won’t do anything because it happens after the WaitForChild.

print backpack.Playing before you do the wait for child, i am desperate at this point, does the print nil or the name, then somethings odd.

Oh wait… it printed out Backpack in the output but when I clicked on it nothing happened. I think what happened is that it located the Backpack, then for some reason the backpack reloaded into a new one.

This is why I hate working with character models and player objects, stuff is always reloading

What you should do is put the script in starter character script, then wait for the backpack in that script so that its for each new character because i think it resets.

Could it be print(backpack:WaitForChild("Playing").Value.Value) since most times if you reference a Value that’s the name of item, but if you put Value.Value you are reading the actual Property.

No I don’t think scripting works like that.

I’ve decided to use an entirely new method for my music. I just put a giant invisible part around the lobby and if your character is inside it then it will play the lobby music.

I just don’t wanna use this anymore because it seems complicated and inefficient.

Have you trying “detecting” the amount you have to wait, simply by doing:

local start = os.time() 
local Playing = backpack:WaitForChild("Playing", math.huge)
print(os.time()-start) --seconds after it loads.