Okay so its still not working, heres the function:
function F18Vehicle::onImpact(%this,%obj,%data)
{
%speed = vectorLen(%obj.getVelocity());
//Lets the pilot have an easy landing
if(%obj.f18gear == 2)
%obj.speedlimit = 10;
else
%obj.speedlimit = 5;
if(%obj.speed > %obj.speedlimit )
{
if(%obj.destroyed)
return;
%obj.setDamageLevel(0);
%obj.destroyed = 1;
%obj.finalexplosion();
%obj.target.islocked=false;
%obj.schedule(10,"delete");
if(isObject(%obj.spawnBrick.client.minigame))
%respawn = %obj.spawnBrick.client.minigame.vehicleReSpawnTime;
%obj.spawnBrick.schedule(%respawn+1000,"spawnVehicle");
}
else if(%obj.speed < %obj.speedlimit)
{
%obj.applydamage(10);
}
}
Any idea as to what ive done wrong?