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

Why won't my sounds remove itself? Why does it loop again?

I have a sound that get played for my intro. Everything works fine except the end. I have it where at the end of the intro, it would remove the screengui and all the children that is along with it. It seems normal but it's not because instead of removing itself, it plays the song over again. This is my code:

local bells = bg.bells --the sound

bells:Play()

wait(5)

bg.bells.Volume = 0 --I added these to make the songs stop making sound but it does not work
bg.haunting.Volume = 0

game:GetService("StarterGui").Intro:Remove() --Trying to remove my intro along with all the children with it

I don't know how to make it stop. Should I just use a different method or not use sounds at all?

7 comments

0

intro as in a loading screen?

0

Not so much as a loading screen. It's pretty much just the title of my game along with credits before it fades out.

0

It sounds a lot like a load screen. You can replace the def one made by Roblox which might be what you want.

0

How would I do that?

0

Your current script is accessing the StarterGui and not the players gui. Also use Destroy not Remove.

0

Lol, I said the exact same thing

1 answer

Ok, so first of all you should reference "intro" earlier making sure it is the correct one. Then you should write the code when you want to stop the sound:

bells:Stop()

And make sure that the bells are not on loop. Having them on loop might be your problem. Do the same for the haunting sound. Finally to remove something you have to do the following:

game:GetService("StarterGui").Intro:Destroy()

If it doesn't work comment and I will see what I can do. Hope this helps!

5 comments

0

Using the :Destroy() method did removing the ScreenGui along with the sound but the sound still plays after it is destroyed. I threw in a bells:Stop() to see if it would work too but it didn't

0

Hmm, that might be a studio bug. Have the sounds actually been removed?

0

Yes. Both in the starter gui and the player's gui. I made sure to target them both.

0

Yeah I think it is a bug. It shouldn't happen.

0

I tried it on the regular server but still the same problem. I think I should just remove everything else other than the sound

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