Solved Giving an Item with Ownership

Discussion in 'Rust Discussion' started by 4lex, Aug 14, 2016.

  1. Hi I was just wondering if it is possible to give an item with a certain player's ownership on it.
    Thanks
    Also how can I run the inventory.give command through csharp using local variables
     
    Last edited by a moderator: Aug 14, 2016
  2. UPDATE: I Figured out how to do this but idk how it wants it formatted
    Code:
    Item item = ItemManager.CreatByName("skull.human", 1);
                item.owners.Add(Item.OwnerFraction(killerID, 1));
                player.inventory.GiveItem(item);
    I keep on getting Expression denotes a `type', where a `variable', `value' or `method group' was expected
     
    Last edited by a moderator: Aug 14, 2016
  3. the fixed code is
    Code:
    Item item = ItemManager.CreateByName("skull.human", 1);
                item.AddOwner(owner, 1);
                player.GiveItem(item);
    note that 'owner' has to be BasePlayer