[ ] is not a valid member of Folder

I’m trying to make an intro script for my friend’s game, and it was working before but all of a sudden it just stopped working after Studio updated.

What I was trying to achieve was a nice tween for the volume of an audio when the player presses play.


But instead it just ignores this line and it just goes straight to the ones I’m pointing to.

Because of this behaviour, I’m getting this error in the output and it’s annoying the hell out of me (by the way line 94 is the first line of code I showed).

I’ve been trying to fix this by using WaitForChild instead of just using “script.Parent.SoundBits” and whatnot but I just get an infinite yield error. Is there any way to fix this abnormal behaviour? It’s obnoxious.

Here’s my code by the way:
https://pastebin.com/KxUWFA7e

Also, this is what it’s meant to look like:
https://twitter.com/theakuma67/status/1098053468760219649?s=20

If script.Parent.SoundsBits is where SoundBits are, you are destroying script.Parent on line 47 in the pastebin you linked. Once that gets destroyed, so does its children including SoundBits. Once SoundBits gets destroyed, you can reference it until it gets collected, but you cannot use FindFirstChild on it, as its children have also been destroyed and are not actually children of SoundBits anymore.

2 Likes

Removing that line of code (script.Parent:Destroy()) fixed the whole thing! Thanks!

1 Like