HI,
I'm not entirely sure why you have what you have, as I suspect there is an easier way to do what you are trying to do. However, I have tried to work with what you have given and would try this below ... do not confuse your sTag and sNewTag by the way.
EDIT: Note, I have removed the need for any nNew variable usage, as this (in theory) should be handled via the conversation choices anyway.
EDIT 2: Note also that sTag should be UNIQUE for every call of this function. i.e. If used in more than one place, then sTag has to be different in every case, and you must have the unique tagged objects within the module in question.
EDIT 3: The variable nTimes could also be eliminated, as you could simply search for the UNIQUE tagged objects in every case and change the while command to
while(oZombie != OBJECT_INVALID) where oZombie has been defined as in
object oZombie = GetObjectByTag("yourtaghere"); EDIT 4: Subject to which type of object you are using as the "dead" zombie, then you could potentially just use the "raise dead" type function on a creature object. I say this because the "SendCreatureToLimbo" says that it only works on creatures. Therefore, your script appears to be doing more work than it needs to if you see what I mean? i.e. Why send the dead zombies to limbo and create new ones if you can simply raise the dead ones and set a new tag for them anyway (if you actually need to do that)?
Cheers,
Lance.
void main(string sTag, int nNew, string sNewTag, int nTimes)
{
int nN = 1;
while(nN <= nTimes)
{
object oLimbo = GetObjectByTag(sTag);
location lLocation = GetLocation(oLimbo);
SendCreatureToLimbo(oLimbo);
object oNEW = CreateObject(OBJECT_TYPE_CREATURE,sTag,lLocation,FALSE,sNewTag);
nN = nN + 1;
}
}