private void buy(Player hero) {
        System.out.println("What will you buy? Current Gold:" + hero.getGold());

        //Prints the inventory of the shop
        String inven = "";
        for (int i = 0; i < getInventory().length; i++) {
            inven += "[" + i + "]" + getInventory()[i].getName() + "(" + getInventory()[i].getGoldWorth() +  "g), ";
        }

        System.out.println(inven + "[" + getInventory().length + "]exit");

        //Gets the users input
        int chosen = -1;
        boolean loop = true;
        while (loop) {
            try {
                System.out.print(">");
                chosen = scan.nextInt();
                scan.nextLine();
                loop = false;
            } catch (InputMismatchException e) {
                TextRPG.invalidInput();
                scan.next();
            }
        }

        //If the input is legal then buy the item, maybe make unsellable items
        if (chosen > -1 && chosen < getInventory().length) {
            if (getInventory()[chosen].getGoldWorth() <= hero.getGold()) {
                hero.getInventory().add(getInventory()[chosen]);
                hero.setGold(hero.getGold() - getInventory()[chosen].getGoldWorth());
                System.out.println("Bought " + getInventory()[chosen].getName() + ".");
            }
            else {
                System.out.println("Not enough gold!");
            }
        }
        else if (chosen == getInventory().length) {
        }//Exits the buying transaction
        else {
            TextRPG.invalidInput();
        }
    }