Corleone Vito 0 Posted February 23, 2023 My scripts: [] spawn { while{true}do{ {if((!alive _x) && (_x != player)) then{deleteVehicle _X}}forEach allDeadMen; sleep 30;}; }; When I entered the game, the dead AI bodies were indeed deleted within 30 seconds, but the dead player bodies were also deleted. I'm thinking that maybe when the player dies (or when they respawn), their body is no longer considered as "player", so it is being deleted along with allDeadMen in the _x ? Share this post Link to post Share on other sites
cool=azroul13 14 Posted February 23, 2023 You Should look at the "killed" eventhandler: Quote Triggered when the unit is killed. Be careful when the killer has been a vehicle. For most cases the reference of the vehicle is the same as the effectiveCommander, but not always. this addEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; }]; unit: Object - object the event handler is assigned to killer: Object - object that killed the unit. Contains the unit itself in case of collisions 1.66 instigator: Object - person who pulled the trigger 1.68 useEffects: Boolean - same as useEffects in setDamage alt syntax 1 Share this post Link to post Share on other sites
_foley 192 Posted February 24, 2023 _x != player isn't gonna work, try this instead: !isPlayer [_x] Share this post Link to post Share on other sites
pierremgi 4927 Posted February 24, 2023 just: addMissionEventHandler ["entityKilled", { params ["_killed"]; if ( _killed isKindOf "CAManBase") then {deleteVehicle _killed} }]; Nothing more needed. Player corpse will remain. Note: you can add : && !(_killed in playableUnits) in condition , letting playable units respawn in MP, without deleting their corpse. Share this post Link to post Share on other sites