1. Hi,

    What event is called when you do an experiment in the workbench?
    It’s to block the learning of the ak and the bolt.

    Thanks you :)
     
  2. There are no hooks for experiments but there is one for researching.

    • Called right before a player begins to research an item
    • Returning a non-null value overrides default behavior

    Code:
    object OnItemResearch(Item item, BasePlayer player)
    {
        //Magic goes here
    }
     
    Last edited by a moderator: Feb 4, 2018
  3. No such hooks, yet.
    If you want to block these items from learning, then this may satisfy your needs.
    Code:
            private void OnServerInitialized()
            {
                foreach (var bannedBp in ItemManager.bpList.Where(bp =>
                    bp.targetItem.itemid == -55660037 || bp.targetItem.itemid == -1461508848))
                    bannedBp.isResearchable = false;
            }
     
  4. Thanks for your help. I make it :


    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;namespace Oxide.Plugins
    {
        [Info("BlockItemResearch", "Sorrow", "0.1.2")]
        [Description("Block Item Research")]    class BlockItemResearch : RustPlugin
        {
            private List<string> itemBlacklist = new List<String>
            {
                "rifle.ak",
                "rifle.bolt",
                "metal.facemask",
                "metal.plate.torso"        };        private void OnServerInitialized()
            {
                foreach (var bannedBp in ItemManager.bpList.Where(bp => itemBlacklist.Contains(bp.targetItem.shortname)))
                {
                    bannedBp.isResearchable = false;
                }
            }
        }
    }
    Edit : Solve
     
  5. @VVoid Do you think it's possible to make these items repairable?
     
  6. Not sure, but you can try removing ItemBlueprint component from specific ItemDefinition objects.

    UPD
    : I guess no, repair bench still requires you to have an unlocked item. Idk how it's work with M249, can't check rn.
     
    Last edited by a moderator: Feb 6, 2018
  7. Sorry i'm french Idk and rn ?

    I tried to see if it was possible to apply the properties of m249 on the AK but I couldn't do it.
     
  8. idk = i dont know and rn = right now
     
  9. Maybe you could apply reverse engineering and let the player learn it so he can repair it but prevent the item from being crafted! Or even maybe have it learned already by default so you dont spend ressource on the research just to repair it.
     
    Last edited by a moderator: Feb 7, 2018