public void buyAbility(int abilityNum) { int AbilityCost; if (PlayerRank > 1) { AbilityCost = 1000; } else { AbilityCost = 2000; } if (AbilityCost > PlayerEXP) { Debug.Log("YOU CANNOT AFFORD THE ABILITY!"); StartCoroutine(expWarningMSG()); } else { Debug.Log("buy ability calling wtih cost of " + AbilityCost); prefs.buyAbilityYo(abilityNum, AbilityCost); cheapoUpdate(); } }