void DetermineSilencedWeaponChance() { if (randomNumber1 < 15) // 15% chance - Silenced weapon { if (rootTag == "Player") { weaponScript.isSilenced = true; weaponScript.transform.GetComponent <ProduceSoundTrigger>().enabled = false; weaponScript.DetermineSoundName(); } else // If enemy { enemyWeaponScript.isSilenced = true; enemyWeaponScript.transform.GetComponent <ProduceSoundTrigger>().enabled = false; enemyWeaponScript.DetermineSoundName(); } } }