_c = 0
#createloop
? (local Server) : "soldierEB" createUnit [[_x0r,y0r,z0r],rusleader,"deadguy=this",.4,"Private"]
[deadguy] join grpNull
deadguy switchMove "CombatDead"
deadguy disableAI "autotarget"
_deadguys = _deadguys + [deadguy]
_c = _c + 1
~.5+(random .5)
? (_c < 5) : goto "createloop"
#initloop
_d = 0
#booyaloop
~5
? ({alive _x} count _deadguys == 0) : exit
? ({_x distance (_deadguys select _d) < 25} count (units group player) == 0) : _d = _d + 1; goto "booyaloop"
(deadguys select _d) switchMove "stand"
_deadguys = _deadguys - [(deadguys select _d)]
? ({alive _x} count _deadguys > 0) : goto "initloop"
exit
Oh, you asked for this only:
deadguy switchMove "CombatDead" and
(deadguys select _d) switchMove "stand" ;D
But nevertheless, that's a worthwile system lagwise I'd imagine, you create all the dead guys in that script (5 of em), add them to an array which is dealth with in the loop while they are alive. The only prob is that it'll detect only the players group and the dead guys might turn around while laying on the ground. disableAI "autotarget" might prevent that but also a watch command might do. As in:
deadguy doWatch [(getpos deadguy select 0) + sin (getdir deadguy + 0) * 20, (getpos deadguy select 1) + cos (getdir deadguy + 0) * 20, 0]
Ofcourse, if they are created as the player closes in (to avoid lag), he might catch a glimpse of them dropping dead. So you can create them below ground and raise them slowly...