Every time I tame a bear it attacks me after being tamed. I've restarted game, called pet to me, different locations too, and it always attacks and kills me. Am I missing a permission? Or configuration setting?
Animals keep attacking after tamed
Same still happening.
Tame a Boar it will attack you and kill you.
All animals now attack once tamed seems to be the buggest breakage of this plugin.
All the other options function.
This is a excellent plugin and would be a shame to let such a small problem with it stop it from working.
Any chance this could be fixed?
All the other options function.
This is a excellent plugin and would be a shame to let such a small problem with it stop it from working.
Any chance this could be fixed?
It's broken because the patcher is broken. The OnNpcTarget hook needs to be fixed for this to continue working.
k1lly0u
It's broken because the patcher is broken. The OnNpcTarget hook needs to be fixed for this to continue working.
Ok Thank you for the reply.
Others are using this codes bascis to control NPC and basically have them act and react like the pets in this mod.
If they can get it working, cannot this plugin be fixed as well?
If they can get it working, cannot this plugin be fixed as well?
hello, like k1lly0u wrote there is a hook what not working and its for example animals targeting player, it cant block a animal from targeting a player.
the problem is your pet animal just attacking u if u are too close to your pet animal else it will not attacking you u could change the pet inv loot distance and i post u a little temp fix this will avoid get damage from the pet animal to the controller player. i have just a little experiance about c# and i dont know if it will get issues to your server performance u could try it.
in line 1 u add this
i test it and it was working, if u get errors PM me with full error i try to help u
Merged post
oh wow there is something went wrong by pasting code it needs this adding
the problem is your pet animal just attacking u if u are too close to your pet animal else it will not attacking you u could change the pet inv loot distance and i post u a little temp fix this will avoid get damage from the pet animal to the controller player. i have just a little experiance about c# and i dont know if it will get issues to your server performance u could try it.
in line 1 u add this
using Rust;it will look like this
using Rust;
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;
using UnityEngine;
using UnityEngine.SceneManagement;
from line 37 to 44 u remove this
private void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo hitInfo)
{
if (entity == null || hitInfo == null)
return;
if (entity is BaseNpc)
entity.GetComponent()?.OnAttacked(hitInfo);
}
and u add this
private void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo hitInfo)
{
if (entity == null || hitInfo == null)
return;
if (entity is BaseNpc)
entity.GetComponent()?.OnAttacked(hitInfo);
NPCController entPlayer = entity.GetComponent();
if (entPlayer != null && hitInfo?.Initiator?.GetComponent())
NullDamage(ref hitInfo);
}
void NullDamage(ref HitInfo hitInfo)
{
hitInfo.damageTypes = new DamageTypeList();
hitInfo.HitMaterial = 0;
hitInfo.PointStart = Vector3.zero;
}i test it and it was working, if u get errors PM me with full error i try to help u
Merged post
oh wow there is something went wrong by pasting code it needs this adding
private void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo hitInfo)
{
if (entity == null || hitInfo == null)
return;
if (entity is BaseNpc)
entity.GetComponent<NpcAI>()?.OnAttacked(hitInfo);
NPCController entPlayer = entity.GetComponent<NPCController>();
if (entPlayer != null && hitInfo?.Initiator?.GetComponent<NpcAI>())
NullDamage(ref hitInfo);
}
void NullDamage(ref HitInfo hitInfo)
{
hitInfo.damageTypes = new DamageTypeList();
hitInfo.HitMaterial = 0;
hitInfo.PointStart = Vector3.zero;
} I get an error after editing the CS and trying to load the plugin.dIMjIM
private void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo hitInfo) { if (entity == null || hitInfo == null) return; if (entity is BaseNpc) entity.GetComponent<NpcAI>()?.OnAttacked(hitInfo); NPCController entPlayer = entity.GetComponent<NPCController>(); if (entPlayer != null && hitInfo?.Initiator?.GetComponent<NpcAI>()) NullDamage(ref hitInfo); } void NullDamage(ref HitInfo hitInfo) { hitInfo.damageTypes = new DamageTypeList(); hitInfo.HitMaterial = 0; hitInfo.PointStart = Vector3.zero; }
Error while compiling: Pets.cs(60,10): error CS1056: Unexpected character `'