//probably transfer theses to a generic upgrade/repair script public void Repair() { float cost = (hs.maxHealth - hs.currentHealth) / 10; Debug.Log(cost); if (MainGameScript.playerSilver > cost) { hs.FullHeal(); MainGameScript.playerSilver -= cost; } Debug.Log(hs.currentHealth); }