1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  1. cookiecool

    cookiecool Wood Hoarder

    I'm trying to create a plugin but it needs to give players items. How would I give a player lets say an ak47 and 2 of them?
     
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Take a look at the Give, Kits, or various other plugins that give items.
     
    hoppel likes this.
  3. Sonny-Boi

    Sonny-Boi Scavenger

    Code (Text):
    player.GiveItem(global::ItemManager.CreateByItemID(-1224598842));
    or alternatively you could use
     
    Code (Text):

    var item = ItemManager.CreateByItemID(523855532, 1);
    item.MoveToContainer(player.inventory.containerWear);
     
    You should start using VisualStudio to find your solutions.
     
    Last edited: Feb 13, 2018
  4. cookiecool

    cookiecool Wood Hoarder

    Is there a way to do it using short prefab names?
     
  5. Slydelix

    Slydelix Plugin Developer

    Code (Text):
    Item one = ItemManager.CreateByName("rifle.ak", 1);
    Item two = ItemManager.CreateByPartialName("rifle.ak", 1);


    Wouldn't be a bad idea to get visual studio
     
  6. cookiecool

    cookiecool Wood Hoarder

    I do have visual studio it just my intellisense works sometimes but not always