I am trying to make physical tools to test each new effect in a place of mine. My first tool, which demonstrates each effect but is not specific, works. Imagine each tool, by the way, as a desk with a play button, a stop button, a player, meters for each property (for the specific ones), and a fake screen w/ a surface gui to change audio. In my new distortion module/tool the priority meter works, so you can ignore that, but the level meter does not. My idea is a scale of 11 chronological buttons representing 0 - 1 (0 being the first button, 1 being the last) by tenths. each button of course has a click detector but also has an Int value. of course I cant use decimals in Int values so my idea is to have the level be the value times .1 when it is clicked. so if I click the button with an Int value of 1 then level should = .1 . I am using Int values because the roblox wiki says that level in sound effects is an int value. - sorry for the long explanation

here is the script: (mostly focus on lines 5 - 16, also the script is not finished so some random variables may exist because i'm going to use them for the future)

place: https://www.roblox.com/games/537101187/New-Audio-Test

i = false
purpel = BrickColor.new(308)
welloy = BrickColor.new(24)

for i,v in pairs(script.Parent.Level:GetChildren()) do
	if v:FindFirstChild('ClickDetector') then
		v.ClickDetector.MouseClick:connect(function(mouse)
			if v:FindFirstChild('Int') then
				v.BrickColor = purpel
				script.Parent.Player.Sound.Distortion.Level = v.Int.Value * tonumber(.1)
				wait(.05)
				v.BrickColor = welloy
			end
		end)
	end
end

for i, b in pairs(script.Parent.PriorityMeter:GetChildren()) do
	if b:FindFirstChild('ClickDetector') then
		b.ClickDetector.MouseClick:connect(function(mouse)
			b.BrickColor = purpel
			wait(.05)
			if b.Name == "N01" then
				script.Parent.Player.Sound.Distortion.Priority = script.Parent.Player.Sound.Distortion.Priority - 1
			end
			if b.Name == "N1" then
				script.Parent.Player.Sound.Distortion.Priority = script.Parent.Player.Sound.Distortion.Priority - 10
			end
			if b.Name == "P01" then
				script.Parent.Player.Sound.Distortion.Priority = script.Parent.Player.Sound.Distortion.Priority + 1
			end
			if b.Name == "P1" then
				script.Parent.Player.Sound.Distortion.Priority = script.Parent.Player.Sound.Distortion.Priority + 10
			end
			b.BrickColor = welloy
		end)
	end
end