Compare clas from diffrent scipt

I will try to compare the two weapons of the two different scripts.

public static bool CompareWeapon(WeaponControl wp1, WeaponControl1 wp2)
{
bool retVal = false;

if(wp1.weaponType == wp2.weaponType1)
{
int random = Random.Range(0, 11);

if(random <= 5)
{
retVal = true;
}
}

And i get error,

Operator ==' cannot be applied to operands of type WeaponManager.WeaponType’ and `WeaponManager1.WeaponType1’

Please help me,
Thanks

You’re trying to compare two things that can’t be compared. Like apples and oranges, as the common expression goes.

The comparison wouldn’t make sense, they aren’t the same thing, so there’s no way they could be equal.

If you wanted to consider 2 things equal, even if they aren’t the same thing, because they represent similar values… you have to define what conditions would make them considered equal, and test for those.