InputBegan InputEnded Connection Problems

I’m using InputEnded to animate my buttons on click. Both Buttons have the same position. However, when input ends for ButtonA, input ends for ButtonB as well, because they overlap each other. I’ve got a simplified form of the code below:

function loadButtonB()
	ButtonB.Visible = true
	ButtonB.InputEnded:Connect(function (input)
		if input.UserInputType.Value == 0 or input.UserInputType.Value == 7 then --This is the key code for mouse 1 or touch
			print("Text")
		end
	end
end

ButtonA.InputEnded:Connect(function (input)
	if input.UserInputType.Value == 0 or input.UserInputType.Value == 7 then --This is the key code for mouse 1 or touch
		loadButtonB()
	end
end)

Is there any way I can isolate the two input connections while keeping their position the same?

“connect” is C capital, also are you getting any error messages?

connect can be used with a capital c or a lowercase

:connect is deprecated. Like @Interactivated said, you should use :Connect.

you would still be able to use it, but this is getting far off topic.