So I have a for loop which runs through all of the buttons and detects when they are touched. Here is an example:

for i,v in pairs(buttons) do
	v.Touched:Connect(function(hit)
		print("Touched")
	end)
end

the problem is after a second or so the touch interest in the button goes away. So I figure it has something to do with the loop. So now I am wondering how to fix it. I have decided to try and use a module script but dont know how I would implement it in this scenario to fix the problem. Could someone please help or suggest a better solution?