removing all "Stones" in inventory

Discussion in 'General Discussion' started by tomasekCZE, Nov 23, 2018.

  1. tomasekCZE
    Offline

    tomasekCZE New Member Member

    Joined:
    Dec 29, 2015
    Messages:
    1
    Likes Received:
    0
    how to remove all "Stones" from inventory by C#, i cant find any code
     
    #1
  2. ice cold
    Offline

    ice cold Active Member Member

    Joined:
    Oct 24, 2016
    Messages:
    583
    Likes Received:
    61
    This should work
    Code (C#):
    foreach(PlayerItem item in player.Inventory.Items)
                {
                    if(item.Name == "Stone Ore")
                    {
                        player.Inventory.RemoveItem(item.Name, item.Quantity);
                    }
                }
     
    #2
    • Like Like x 1
    • Agree Agree x 1

Share This Page