Hi, i recently added pianos in my game Mossy Grove, however the game has music aswell. i want the music to stop playing when the player is seated on the piano bench, when the player gets off it should start playing again. does anyone know how thats posible. theres also a mute music button, it uses volume. can anyone help to find the right solution for me?
Heres the script the music uses.
local SongsList = {"rbxassetid://13750874337", "rbxassetid://13758464835", "rbxassetid://13673577343", "rbxassetid://13750957344", "rbxassetid://13758567291", "rbxassetid://13751296484", "rbxassetid://13751116938", "rbxassetid://13758468499", "rbxassetid://13753573646", "rbxassetid://13757342102", "rbxassetid://13757365808", "rbxassetid://13758492839"}
----------------------------------------------------------------------------------------------
local Sound = workspace:WaitForChild("Sound1")
local function PlaySongs()
for Index = 1, #SongsList do
Sound.SoundId = SongsList[Index]
Sound.TimePosition = 0
Sound.Volume = 0.5
Sound:Play()
wait(Sound.TimeLength)
if Index == #SongsList then
PlaySongs()
end
end
end
PlaySongs()