Ped attack count



I’ve made a script that spawns PED’s, but only 1 seems to attack me at any given time (sometimes 2, at most 3). I’d like to make them all attack me at once

Is there any reason for this? See below combat properties I’m setting.

SetPedArmour(ped, 100)
SetPedAccuracy(ped, 25)
SetPedSeeingRange(ped, 100000000.0)
SetPedHearingRange(ped, 100000000.0)

SetPedFleeAttributes(ped, 0, 0)
SetPedCombatAttributes(ped, 46, 1)
SetPedCombatAbility(ped, 100)
SetPedCombatMovement(ped, 2)
SetPedCombatRange(ped, 2)


I seem to remember reading somewhere that this limit of 3 peds attacking you at once is a limit by the game, don’t know if you can modify it. I can’t provide a decent source so take it with about a quarter pound of salt.


thats depressing, don’t more than 3 cops attack a single player at once?


Do you mean only 3 peds can be hostile or only 3 hostile peds can attack at once? Because if you fire a shot on Grove Street there are several red circles (enemies) on the minimap and they all are hostile.


I think they are all hostile but only 3 will ever attack me at any given time (based on my testing). I’m looking to have a horde like mode where more than 3 will try to attack you.

Basically I spawn a bunch of Peds, shoot once they all look at me, and 3 come at me, the rest just stare and watch. If i run through the crowd, 3 different ones attack me or a new ped will attack me, but there will only be 3 after me at any given time.


Ah, that makes sense. I always seen more than 3 on the minimap on Grove I just never payed attention to who or when they attacked. Kinda figured they all did at will. Good info to know.


I guess if anyone knows where I could go looking to reverse this limit myself, that would be ideal.


Well, I know the RottenV server/gamemode has a load of people (zombies) chasing you at a single time. Maybe you could look into the code for that or ask @Bluethefurry how it is done. Its probably relationship groups. I haven’t worked with them, so I’m not sure how to instruct on using them. I just know they do stuff :stuck_out_tongue:


Appreciate the response, my script is based on that RottenV mod (I think an older version). I’ll try out the latest version of RottenV to see whats good.



Just looked into it a little bit, and yeah – it uses relationship groups. You can see a little snippet of it here (setting the groups) and here (applying the group to the ped). I’m not sure if more is needed.

Here are the different group meanings.


I actually already use relationship groups, see linked code


Relationship groups won’t change the limit, only 3 peds will attack at once. I even tried to dynamically create groups but the game has a limit (20 groups I think).


:frowning: Is there any documentation on this limit?

Has anyone made attempts at reversing the limit?


Nope, just tried to create groups in a loop and after a few milliseconds it broke the script.


I just went back in the server to look, and for some reason sometimes a boat load of them will chase, at other times only 3. But as for attacking, only 3 max. I also tested myself on my server, and yeah… 3 max. Hm…


I made my own zombie core using ESX and I went playing with AI. Far more difficult to set. But far more efficient. I made up to 200 zombies following me, but only 3 max can attack at the same time. The secret is to set the ped to attack at the right time.

EDIT: Couldn’t go over 200 the pool was full then the client crashed.


how can you get 200 zombies?
pls help?