Thank you for replying.
Appologies, I never sent the whole code segment but thought it better not to put too much in my first post. I do already have that native function included further down. I have the below but the Peds still continue to flee:
NativeFunction.CallByName<uint>("SET_BLOCKING_OF_NON_TEMPORARY_EVENTS", NPC, 1);
NativeFunction.CallByName<uint>("SET_PED_FLEE_ATTRIBUTES", NPC, 1, 1);
//NativeFunction.CallByName<uint>("SET_PED_COMBAT_ATTRIBUTES", NPC, 46, true);
NPC.RelationshipGroup = "MYENEMY";
WeaponAsset NPC_Knife = new WeaponAsset("WEAPON_BAT");
NPC.GiveNewWeapon(NPC_Knife, 1, true);
Game.SetRelationshipBetweenRelationshipGroups("MYENEMY", Game.LocalPlayer.Character.RelationshipGroup.Name, Relationship.Hate);
NativeFunction.CallByName<uint>("TASK_COMBAT_PED", NPC, Game.LocalPlayer.Character, 0, 1);
As you can see I have also created the group relationships; and I presume this works because when the code runs and the Ped is set to the Enemy group and the relationship is 'Enemy'; some other peds in the area run away as they see two enemies (I am presuming this is a default action for peds who see 2 enemies within their vicinity).
P.S. Ignore the variable stating knife but weapon being a bat - playing about!