function AirDragonArmor::onTrigger(%this, %obj, %trig, %press) {
if(%trig == 2 && %press && getsimtime() >= %obj.lastjump+400)
{
%obj.forbidJump = true;
%obj.addVelocity("0 0 24");
%obj.playThread(0, "Jump");
ServerPlay3D(AirDragonJumpSound, %obj.getPosition());
%obj.lastjump = getsimtime();
}
else Parent::onTrigger(%this, %obj, %trig, %press);
}
I ripped the above code out of the Player_Dragons pack.
In the line:
if(%trig == 2 && %press && getsimtime() >= %obj.lastjump+400)
Is this checking if a key as been pressed (%press), that the pressed key is the jump key (%trig == 2), and checking if it has been 400 milliseconds since the last time the function was triggered successfully (getsimtime() >= %obj.lastjump+400)?