Sound.Volume not working

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)


Is it a Regular or Local Script? Also could you add print() statements to see what the sound.Volume outputs as?

Its in a local script, and I dont know how but its fixed. I think the problem was in another script. I changed my muteall script to be more efficient and it seems as though that has solved the issue.

Ah gotcha, glad you got it fixed though :smile: (Do make sure to Mark your answer as a solution)

1 Like