I tried making a function that activates on a RemoteEvent being triggered. It's triggered by the player's mute music button. Here's the code in ServerScriptService for when it's triggered:
-- Mutes/unmutes the player's music
game.ReplicatedStorage.muteMusic.OnServerEvent:Connect(function(player)
local isMuted = workspace.isMuted.Value
local playing = workspace.audio1.Playing
if isMuted == true then -- Music is muted
-- Make music unmuted
isMuted = false
playing = true
-- Just making sure
print("Unmuted")
else -- Music is not muted
-- Make music muted
isMuted = true
playing = false
-- Just to make sure it works
print("Muted")
end
end)
It prints "Muted" every time I press it. Please help me if you can. Thx.
