Animals and NPCs still kill each otherSolved
Hi,
i tried to find out what EXACTLY this plugin is doing but could not.

-Murderers still attacking Scientists (NPC vs NPC)
-Murderers still attacking animals (NPC vs Animal)
-Scientists still attacking Murderers (NPC vs NPC)
-Wolf still attacks Boar (Animal vs Animal)

I thought all not-players just dont attack each other?
Weird, thank you for your report. Can you try with the previous 1.0.1 version?
no i can't.
it never worked for me, that's why i kiddie scripted something into it.
//Called when an NPC player targets another entity
		//Returning a non-null value overrides default behavior
		//https://umod.org/documentation/games/rust#onnpcplayertarget
        private object OnNpcPlayerTarget(NPCPlayerApex npcPlayer, BaseEntity entity)
        {
			if((npcPlayer) != null && (npcPlayer.name == "assets/prefabs/npc/murderer/murderer.prefab" || npcPlayer.name == "assets/prefabs/npc/scarecrow/scarecrow.prefab"))
			{
				//Puts(npcPlayer.name + " targets " + entity.name);
				if((entity != null) && (entity.name.Contains("/rust.ai/agents/") || entity.name.Contains("/bandit")))
				{
					//Puts(npcPlayer.name + " targets " + entity.name);
					return true;
				}
			}
            return null;
        }​

This one worked for me, but the hook will be gone anyway, thats why i updated.

NPCPlayerApex only covers the old Murderer NPCs. There were no hooks until recently for the newer Scientist NPCs.

All NPCs can now be handled via a generic OnNpcTarget(BaseEntity) in most cases.
Locked automatically