I’m using Rain Plugin (Rain plugin) in my experience, but the sound is too loud even when i put the sound on the minimum volume.
So i came up with an idea, the idea is that i will add on/off rain volume button.
But the problem is i have no idea what to do… I could make on/off music button easily, but I’m not that familiar with plugins…
Could anyone help me please?
Some info:
Rain sound asset id: 1516791621
Rain editor:
The sound isn’t there yet, because it hasn’t been created by the rain plugin yet, You’ll have to do it through a script.
Put this script inside of a button.
local button = script.Parent
local sound = game.SoundService:WaitForChild("__RainSoundGroup"):WaitForChild("RainSound")
local originSoundVolume = sound.Volume
local Switch = true -- /// Debounce
button.Activated:Connect(function()
if Switch then
Switch = not Switch -- Turns the debounce on or off depending on what it is
sound.Volume = 0 -- Turns the volume off
elseif not Switch then
Switch = not Switch -- Same here
sound.Volume = originSoundVolume -- Turns the volume back on, you can change this with a number if you want.
end
end)
local button = script.Parent
local sound = game.SoundService:WaitForChild("__RainSoundGroup"):WaitForChild("RainSound")
local originSoundVolume = sound.Volume
local Switch = true -- /// Debounce
button.Activated:Connect(function()
if Switch then
Switch = not Switch -- Turns the debounce on or off depending on what it is
button.Text = "Rain Sound: Off" -- Change this to make the text whatever you want it to be
sound.Volume = 0 -- Turns the volume off
elseif not Switch then
Switch = not Switch -- Same here
button.Text = "Rain Sound: On" -- Change this to make the text whatever you want it to be
sound.Volume = originSoundVolume -- Turns the volume back on, you can change this with a number if you want.
end
end)