Request a 'Deleted' event handler.
myvehicle addEventHandler [
'Deleted',
{
_object = _this select 0; // The vehicle object
}
];
VBS 3 has this, though I am not sure how it works.
https://resources.bisimulations.com/wiki/Category:VBS:_Event_Handlers#Delete
With a 'Deleted' event handler, scenario designers can reduce the number of scripts running, related to respawns and vehicles. At the moment, we have to run an evaluation thread to detect 'isNull' on the vehicle, prior to creating a new one (respawning).
'Killed' event handler does not detect all eventualities in MP sessions, where a vehicle may simply vanish (whether by human input or otherwise), yet it should be replaced.
With both a 'Killed' and 'Deleted' event handler, we could have vehicle respawn scripts without any evaluation threads.