im not real sure what effect your going for here with %waves always set to 1.
but try this and see if it makes more sense. note its UNTESTED
function DoomNukeRocketProjectile::onExplode(%this,%obj)
{
parent::onExplode(%this, %obj);
schedule(400, 0, "DoomNukeRocketProjectile::LaunchWave", %this, %obj, 1);
}
function DoomNukeRocketProjectile::LaunchWave(%this,%obj, %waves)
{
%projectile = NukeWaveProjectile;
%position = %obj.getPosition();
for (%numbar=0; %numbar<%waves; %numbar++)
{
if ($times > 8)
{
$times = 0;
return;
}
%x = (getRandom(-7,7) - 0.5) * 3.141592653;
%y = (getRandom(-7,7) - 0.5) * 3.141592653;
%z = (getRandom(-7,7) - 0.5) * 3.141592653;
%velocity = %x SPC %y SPC %z;
%p = new projectile()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %position;
sourceObject = %obj;
sourceSlot = %obj.client.player.lastFragslot;
client = %obj.client;
};
$times++;
%this.schedule(400, "LaunchWave", %p, %waves);
MissionCleanup.add(%p);
}
}