hello i create so that my two music plays when the other would have finished and also I also created a gui button so that the player wishes to deactivate the music but the script does not work so if someone can help me it will be really good
here is the script
local soundIdList = {
5409360995, – ID de la première chanson
5410085763, – ID de la deuxième chanson
– Ajoute d’autres ID de chansons ici si nécessaire
}local currentSoundIndex = 1
local currentSound
local isMuted = falselocal function playNextSong()
if currentSound then
currentSound:Stop()
endif isMuted then
return
endif currentSoundIndex > #soundIdList then
currentSoundIndex = 1
endlocal soundId = soundIdList[currentSoundIndex]
currentSound = game:GetService(“SoundService”):PlayLocalSound(soundId)
currentSound.Ended:Connect(function()
currentSoundIndex = currentSoundIndex + 1
playNextSong()
end)
endlocal function toggleMute()
isMuted = not isMutedif isMuted then
if currentSound then
currentSound:Stop()
end
else
playNextSong()
end
endlocal player = game.Players.LocalPlayer
local gui = player.PlayerGui:WaitForChild(“MuteGui”) – Remplace “Gui” par le nom de l’objet GUI dans ton jeulocal muteButton = gui:WaitForChild(“
”) – Remplace “MuteButton” par le nom du bouton Mute
local unmuteButton = gui:WaitForChild(“”) – Remplace “UnmuteButton” par le nom du bouton Unmute
muteButton.MouseButton1Click:Connect(function()
toggleMute()
end)unmuteButton.MouseButton1Click:Connect(function()
toggleMute()
end)