This is supposed to make the player crouch when the key is depressed, then stand up when key is no longer depressed:
_K_
Code:
#----------------------------------------
# New crouch
#----------------------------------------
symbols
message startup
message activated
thing player local
vector playerVel local
vector thrust local
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
Return;
# ........................................................................................
activated:
thrust = GetThingThrust(player);
if((VectorY(thrust) == 0) && (VectorX(thrust) == 0))
{
SetPhysicsFlags(player, 0x10000); // will cause player to crouch.
}
Return;
# ........................................................................................
deactivated;
ClearPhysicsFlags(player, 0x10000); // stand player up.
Return;
#..
end
_K_

)