Log in to reply
 

How do i make my script detect when i kill my spawned peds?



  • I was trying to make a script that involves you having to kill 5 certain peds that i earlier coded to spawn.
    The problem is that I have no idea how to make the game detect when you kill them so that the script can continue. If anyone can help me please do so.
    World.CreatePed(fe, (spawn1));
    World.CreatePed(fe, (spawn2));

    World.CreatePed(fe, (spawn3));
    World.CreatePed(ma, (spawn4));

    World.CreatePed(ma, (spawn5));
    Btw im in c#



  • @M8T keep a reference to the ped when creating it.

    Ped ped = World.CreatePed();

    If(ped.isDead) doSomething();



  • @mcal9909 It says dosomething does not exist in the current context and that An object reference is required for the non-static field, method, or property "Entety_is_dead"

    By the way I'm sorry, I started coding literally two days ago so I'm quite new.
    Aslo what do you mean by always keep a reference?


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.