Sound playing twice even though there is only one instance of the Sound

  1. What do you want to achieve? Keep it simple and clear!
    I am trying to play music when the player joins, lower the volume after the player clicks “Play”, and finally stops the audio.

  2. What is the issue? Include screenshots/videos if possible!
    The audio is playing twice, then plays only one instance after clicking “Play”

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried:
    Looking through Explorer to see if there is a duplicate of the music. There wasn’t.
    Trying to restart Roblox Studio.

Code:
https://pastebin.com/raw/FnVvDXqR

2 Likes

I had this problem before. Instead of having the ‘Playing’ property on the Sound set to true, you should do :Play() in a local script because the second sound is probably coming from StarterGui on the server, which is playing because the ‘Playing’ property is set to true.

6 Likes

It works now, thanks! Will mark this answer as solved.

This may an old post but I’m gonna share helpful info. Adding onto this,
this code will act like a debounce since it checks if the sound is even playing before playing it again.

if sound.IsPlaying ~= true then
   sound:Play()
end
1 Like