Spawn NPCs and Enemies randomly

Hi community,

I want to ask if you can give me a tutorial which tells me how i can spawn NPCs (which run away from the actor if he does something) at random places
and enemys who attack actor (with a gun or sth)
but spawn maximum at about 500 “normal” people and 100 “enemies” or so.

thanks in advance