im not sure what you mean by "it started and it prayed prot melee and at the same tick it attacked an NPC. 1 tick later it walks on the opposite site of the room.". could be completely usual behavior, i don't have enough context to tell you what's wrong if anything