seeing as you haven't responded, I decided to go a bit more in depth.
package Rololol
{
function Armor::onTrigger(%datablock,%player,%slot,%val)
{
Parent::onTrigger(%datablock,%player,%slot,%val);
if(%slot == 3) //Here we check if a player is crouching and return a value if he is.
%player.isCrouching = %val; //Here we modify the value depending on if they are crouching. 1 for yes, 0 for no.
announce(%player.isCrouching);
}
function player::damage(%obj, %sourceObject, %position, %damage, %damageType)
{
if($DamageType_Array[%damageType] $= "Fall" && %obj.isCrouching == 1) //We check here if the damage they are recieving is from falling, and if they are crouching.
%damage = %damage*(%value/100); //Here we reduce damage if both of the above are true. This converts numbers into percents, incase I want a player to recieve only 75% of the damage.
parent::damage(%obj, %sourceObject, %position, %damage, %damageType);
}
};
activatePackage(Rololol);