I Need Help With UIS

backstory :so i have a script that just fires a function on left clicking. ideally this should work perfectly but when i am pressing the button nothing happens.So i try adding a print to function as it wasnt firing. but it didnt. so that meant it didnt fire. so now i added warn to this UIS function. it warns as expected BUT in the Output Prints as follows:

Not key or currentObject
XD -- I Understand that it prints the string as i have a if else statement with and
Enum.UserInputType.MouseButton1 -- BUT THIS IS THE EXACT ENUM AS BELOW THEN WHY DOESNT THE FUNCTION FIRE?! (sorry for caps)
UIS.InputBegan:Connect(function(Key,GPE)
	if Key == Enum.UserInputType.MouseButton1 and variable then
		XYZ(plr,currentObject)
	else
		warn("Not key or currentObject")
		warn(variable)
		warn(Key.UserInputType)
	end

if both expressions are satisfied then why doesnt the function fire?

UIS.InputBegan:Connect(function(Key,GPE)
	if Key.UserInputType == Enum.UserInputType.MouseButton1 and variable then
		XYZ(plr,currentObject)
	else
		warn("Not key or currentObject")
		warn(variable)
		warn(Key.UserInputType)
	end