I'm making a gamemode and I want it at times to spawn missiles in the sky that rains down on everyone below. The problem is: the projectiles aren't doing any damage. Here's the code:
for(%i = 0;%i < ClientGroup.getCount();%i++)
{
%subClient = ClientGroup.getObject(%i);
%location = %subClient.player.getTransform();
%x = getWord(%location, 0);
%y = getWord(%location, 1);
%z = getWord(%location, 2);
%x += getRandom(-10, 10);
%y += getRandom(-10, 10);
%z += 50;
%position = %x SPC %y SPC %z;
//messageAll('', %position);
%proj = new Projectile()
{
dataBlock = tankShellProjectile;
//dataBlock = gravityRocketProjectile;
initialPosition = %position;
initialVelocity = 0;
//sourceObject = 0;
minigame = %subClient.minigame;
//client = %subClient;
};
%proj.dump();
MissionCleanup.add(%proj);
}
When I set client = %subclient, it does damage, but obviously that wont work because if someone gets killed by a rocket meant for someone else, that other person will get credit for blowing someone up. That's not preferable. I don't want anyone to get the credit for these kills so I don't want to set a client. But if I don't set a client, it doesn't do damage.