Can somebody help me? When I click on the "Part" the song play and while the song is playing, I tried to click it again and the song start all over again. I don't want that, I want the song to play until it is finish and then I can click it again to play the song. I already added in the code for it but for some reason it doesn't work in the actual game when I tested it. It work in studio though and I can't find the solution to it. Any idea why is this happening?
Brick = script.Parent
Sound = Brick.Sound
Debounce = false
function onClicked()
if not Debounce then -- If the debounce is false
Debounce = true -- Change it to true
Sound:Play()
wait(Sound.TimeLength) -- Wait til it ends
Debounce = false -- Change it to false
end -- End the if function
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

4 comments
Your script is working for me, can you show the hierarchy?
Did you tested it in studio or the game?
Here's the radio layout I've made: https://gyazo.com/98b9cc2e1c0c05b70dc519916141df36
Sorry about my previous answer not working, I've updated it now! Hopefully that will work for you. I didn't realise .Loaded and .IsLoaded were disabled.