1. Is there a way to call this from HumanNPC

    Code:
    var humanPlayer = npc.GetComponent<HumanPlayer>();
    and get the return to send this call?

    Code:
    HumanNPC?.CallHook("humanPlayer.StartAttackingEntity", player);
     
  2. Wulf

    Wulf Community Admin

    No, you cannot call variables with .Call / .CallHook, only private methods. If you use the // Requires: HumanNPC (this goes at the top of your plugin, makes your plugin reliant on the other plugin) method, you should be able to access any public variables or methods.
     
  3. what im trying to do is call this.

    Code:
            void OnEnterNPC(BasePlayer npc, BasePlayer player)
            {
                if (player.userID < 76560000000000000L) return;
                var humanPlayer = npc.GetComponent<HumanPlayer>();
                if (humanPlayer.info.message_hello != null && humanPlayer.info.message_hello.Count > 0)
                    SendMessage(humanPlayer, player, GetRandomMessage(humanPlayer.info.message_hello));
                if (humanPlayer.info.hostile && player.GetComponent<NPCEditor>() == null && !(bool)(Vanish?.CallHook("IsInvisible", player) ?? false))
                    humanPlayer.StartAttackingEntity(player);
            }
    But humanPlayer.info.hostile stops me from calling an attack because it = false
    is there any way around this other then adding in new call in HumanNPC
    [DOUBLEPOST=1487063585][/DOUBLEPOST]where would i add the Requires: HumanNPC
    [DOUBLEPOST=1487063768][/DOUBLEPOST]When adding to the top i receive Error while compiling Npctp.cs(2,0): error CS1525: Unexpected symbol `Requires'
    [DOUBLEPOST=1487063818][/DOUBLEPOST]forgot the // lolz i got it thanks