I am trying to change a player’s sound volume, however when I try and se the volume to a value in a script it doesn’t change. I am not sure why this isn’t working, for example if I set sound.Playing = false it will stop the sound, meaning the script can definately access it but for some reason it cant change the volume.
This is my code:
local muteGui = script.Parent
local frame = muteGui:WaitForChild("Frame")
local mute = frame:WaitForChild("mute")
local unmute = frame:WaitForChild("unmute")
local playerName = muteGui.Name
local character = game.Workspace:WaitForChild(playerName)
local boombox = character:WaitForChild("boombox")
local sound = boombox:WaitForChild("Sound")
mute.MouseButton1Up:Connect(function()
mute.Visible = false
unmute.Visible = true
sound.Volume = 0
end)
unmute.MouseButton1Up:Connect(function()
unmute.Visible = false
mute.Visible = true
sound.Volume = 0.5
end)