local function F(F,C,R,I)local S=math.random(0,9999999)IsTweeningVolumeSession=S for R=0,1,1/(R/.03)do if IsTweeningVolumeSession~=S then return S end local I=F*(1-R)+C*R WaterLoop.Volume=I wait()end WaterLoop.Volume=C if I then WaterLoop:Stop()end end
-- Tweens volume for more dynamic shut off
local function TweenVolume(FromVolume, ToVolume, Duration, ShouldStopAfterTween)
	local CurrentSession = math.random(0, 9999999)
	IsTweeningVolumeSession = CurrentSession
	for i = 0, 1, 1 / (Duration / 0.03) do
		if IsTweeningVolumeSession ~= CurrentSession then
			return CurrentSession
		end

		local NewVol = FromVolume * (1 - i) + ToVolume * i

		WaterLoop.Volume = NewVol

		wait()
	end

	WaterLoop.Volume = ToVolume

	if ShouldStopAfterTween then
		WaterLoop:Stop()
	end
end
