Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- || 📜 AUTHOR: @4zx16 || MUTE/UNMUTE
- ]]
- local muteButton = script.Parent
- local music = game:GetService("ReplicatedStorage").Music
- local currentTrack = game:GetService("ReplicatedStorage").CurrentTrack
- local muted = false
- muteButton.MouseButton1Click:Connect(function()
- local nowPlaying = music[currentTrack.Value]
- nowPlaying.Volume = muted and 0.5 or 0
- muted = not muted
- end)
- currentTrack:GetPropertyChangedSignal("Value"):Connect(function()
- local nowPlaying = music[currentTrack.Value]
- if muted == true then
- nowPlaying.Volume = 0
- elseif muted == false then
- nowPlaying.Volume = 0.5
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement