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

Button Script Does not execute when clicked. Any fixes? [CLOSED]

I am trying to get this script to work but it is not for some reason. I cannot find the problem... Please see the script below:

local Button = script.Parent
function Clicked()
    local Frame = script.Parent.Parent.Parent 
    local a = script.Parent.Parent.AudioIDInsert.Text
    local b = script.Parent.Parent.Parent.Parent.MusicForPlayers
    	wait(0.1)
    		b:Pause()
    			b.Volume = 1
    			wait(0.1)
    				b.SoundId="http://www.roblox.com/asset/?id=" .. a
    			wait(0.1)
   			 b:Play()
    	wait(0.1)
    Frame:Destroy()
end
Button.MouseButton1Click:connect(Clicked)

Thanks to all those who are making an attempt to help.

2 comments

1

It looks like the sound is parented inside the frame? Wait for the sound to finish playing with b.IsPlaying before destroying.

1

I have fixed the script. Thanks for the suggestion!

1 answer

✓ Accepted answer

It looks like the sound is parented inside the frame? Wait for the sound to finish playing with b.IsPlaying before destroying.

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