[Unsolved] MouseButton1Click/Activated Event Connected In Loop Not Firing

I’ve tried making this system where a list of imagebuttons in a scrolling frame are looped through, and have an event connected to it when clicked. When clicked it SHOULD change the text of certain instances.
The problem is, despite the imagebuttons existing, for some reason, the events straight up not fire.
I’ve tried beefing up the ZIndex and having the connected function be a coroutine that initiates the function, but it still doesn’t work. Any ideas on how I can fix this?

also note that this is a local script.

Here’s an excerpt from the code:

– tool_tip, gear_Name, gear_Icon, and type_Name are all instances that are changed
– weapons is a folder of tools

for _, mini_Slot in ipairs(scrolling_Frame:GetDescendants()) do

if mini_Slot:IsA("ImageButton") then
	mini_Slot.Active = true
	mini_Slot.ZIndex = 1000
	
	local weapon = gears:FindFirstChild(mini_Slot.Name, true)
	print(mini_Slot) -- this prints

	local function on_Click()
		print("clicked") -- and this doesn't
		tool_tip.Text = mini_Slot.Name
		gear_Name.Text = mini_Slot.Name
		gear_Icon.Image = mini_Slot.Image
		type_Name.Text = weapon:GetAttribute("Type")
		tool_tip.Visible = true
		gear_Name.Visible = true
	end
	mini_Slot.MouseButton1Click:Connect(on_Click)
	
end

end

task.wait(0.1) --ImageButton loaded pause
for _, mini_Slot in ipairs(scrolling_Frame:GetDescendants()) do
	if mini_Slot:IsA("ImageButton") then
		mini_Slot.Active = true
		mini_Slot.ZIndex = 1000
		local weapon = gears:FindFirstChild(mini_Slot.Name, true)

		mini_Slot.MouseButton1Click:Connect(function()
			print("clicked")
			tool_tip.Text = mini_Slot.Name
			gear_Name.Text = mini_Slot.Name
			gear_Icon.Image = mini_Slot.Image
			type_Name.Text = weapon:GetAttribute("Type")
			tool_tip.Visible = true
			gear_Name.Visible = true
		end)
	end
end

May want to check if everything is set up right.

it still doesn’t work [I already added a character and game.loaded pause]

IDK about jumping back like that for the connect.
Original script look like it was fine however.
try task.wait(3) or a WaitForChild()

I think something else is wrong myself.

Make sure Active and Interactable are checked.
Try also using Activated instead of MouseButton1Clicked.

I enabled them and changed the event, still doesn’t work.