I'm trying to make a background music volume setting.
The current script is this:
script.Parent.MouseButton1Click:Connect(function()
if game.SoundService.BackgroundMusic.Volume <= 1 then
game.SoundService.BackgroundMusic.Volume = game.SoundService.BackgroundMusic.Volume + 0.1
script.Parent.Parent.Value.Text = game.SoundService.BackgroundMusic.Volume
elseif game.SoundService.BackgroundMusic.Volume == 1 then
return
end
end)
I have some text that displays the current volume of the background music. But everytime i change the volume with the script. It changes to 0.00000142141.
I want to change it so it's just 0.1
Thanks.

2 comments
use int value instead, do volume = volume + 1 / 10 it will get you 0.1
math.floor(x) can help you