normally the players addeventhandler killed runs a respawn script
lets say that you have all units AI and players running the "Killed.sqs" from the killed eventhandler
A combined script would look like the following
KILLED.sqs_body = _this select 0
?!(local Player): goto "REMOVEBODY"
?(Player != _body):goto "REMOVEBODY"
Player removealleventhandlers "killed"
@alive player
player addEventHandler ["killed", {_this exec "killed.sqs"}]
#REMOVEBODY
~ 30 + (Random 30)
deletevehicle _body
exit
I dont actually know if you need to remove the eventhandler and re add it to the player after he has died, never tried it out
NB>>> Any AI that is controlled by a player, is local to the players machine
the lines
?!(local Player): goto "REMOVEBODY"
?(Player != _body):goto "REMOVEBODY"should take care of that for ya!