SliderGui script stopped working after change

In the SliderGui script I used for this, I changed (local fountains) to control multiple particles, as the group I tried to make should do.

But the script stopped working after I did that, and I’m not sure why. (somewhere near the end of the script should say “fountains.Speed = …” which I also edited)

-- Static variables

-- -- UI-related
local slider : GuiObject = script.Parent.Bar
local knob : TextButton = slider:FindFirstChild("Knob") :: TextButton
local previousSliderValue = 0
local sliderValue = 0 -- A multiplier between 0 to 1.

-- -- Target-related
local fountains = {
workspace.Fountain1.cannon.core.fountain,
workspace.Fountain2.cannon.core.fountain,
workspace.Fountain3.cannon.core.fountain,
workspace.Fountain4.cannon.core.fountain,
workspace.Fountain5.cannon.core.fountain,
workspace.Fountain6.cannon.core.fountain,
workspace.Fountain7.cannon.core.fountain,
workspace.Fountain8.cannon.core.fountain
}
local speedRange = Vector2.new(0, 90) -- Set the minimum and maximum speed here. (MinimumValue, MaximumValue)

-- -- Services
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")

-- -- Dynamic variables
local mousePositionOnClick = Vector2.zero -- Starting from the point where the mouse clicked.
local mousePositionOnMove = Vector2.zero -- Updates every mouse move.

local trackingConnection : RBXScriptConnection
local isTrackingMouse = false
local isMouseOverKnob = false

-- Functions

-- -- A linear interpolation (Lerp) function for speed.
local function GetNewSpeed(Value : number) : number
	return speedRange.X + (speedRange.Y - speedRange.X) * math.clamp(Value, 0, 1)
end

-- -- Slides with the mouse.
local function UpdateSlider(Value : number)
	knob.Position = UDim2.new( -- Retain most of its position minus X.Scale.
		UDim.new(Value, knob.Position.X.Offset),
		knob.Position.Y
	)
end

-- -- Get the "delta" between the initial position of click to the current mouse position.
local function GetDelta()
	return mousePositionOnMove - mousePositionOnClick
end

-- -- Start tracking the mouse upon pressing.
local function StartTrackingMouse()
	if isTrackingMouse then
		return
	end

	mousePositionOnClick = UserInputService:GetMouseLocation() -- Set initial mouse position.

	trackingConnection = UserInputService.InputChanged:Connect(function(Input)
		if Input.UserInputType == Enum.UserInputType.MouseMovement then
			local barCurrentSize = slider.AbsoluteSize.X
			mousePositionOnMove = UserInputService:GetMouseLocation()

			local delta = GetDelta()
			local scaleOffset = delta.X / barCurrentSize
			local newPosition = math.clamp(previousSliderValue + scaleOffset, 0, 1)

			sliderValue = newPosition
			fountains.Speed = NumberRange.new(GetNewSpeed(newPosition))

			UpdateSlider(newPosition)

			-- This just updates the textbutton's text. You can remove this safely if you don't use a textbutton, or you just don't want text.
			knob.Text = tostring(math.floor((newPosition * 100)) / 100)
		end
	end)

	previousSliderValue = sliderValue

	isTrackingMouse = true
end

-- Stop tracking the mouse upon user releasing it.
local function StopTrackingMouse()
	if not isTrackingMouse then
		return
	end

	trackingConnection:Disconnect()

	isTrackingMouse = false
end

knob.MouseButton1Down:Connect(StartTrackingMouse)
UserInputService.InputEnded:Connect(function(Input)
	if Input.UserInputType == Enum.UserInputType.MouseButton1 then
		StopTrackingMouse()
	end
end)

I changed (local fountains) to (local fountain = workspace.Fountain8.cannon.core.fountain)
and it worked again.
It was a typo, but changing it to one fountain worked, and when I made it a table, it didn’t.

Yeah, it was originally one fountain being controlled.

But I tried with grouping methods or the pairs code, and it stopped working either way.
Probably some errors in trying to format it correctly, which I’m unaware of.