How to create hostile peds

Hey folks! So i’m struggling to create a ped that turns hostile to me when i get near it. I want it to defend an area, but i cant seem to get them to turn hostile to me when i approach, they kinda just… derp stand there and flee when i poke them with a gun. What am i missing?
I’v got CreatePed(hash,x,y,z,true, true) to spawn the rotter, iv created a group and added him to it, turned that group hostile to players, and yet nothin.

TaskCombatPed

1 Like

TaskCombatPed in combination with setting the relationship between groups and the following works for me:

SetPedCombatAttributes(pedId, 46, true);
SetPedFleeAttributes(pedId, 512, true);
SetPedCombatAttributes(pedId, 35, true);
SetPedSeeingRange(pedId, 50.0);
SetPedIdRange(pedId, 50.0);

Which is based on: rdr3-decompiled-scripts.1232/cornwall1_outro.c at 023e299cb6050ce07b5aad4147df58e304c0450f · stianhje/rdr3-decompiled-scripts.1232 · GitHub

1 Like