I have a script that will make a set of wings move to flap by script coding, not animation. I am allowed to modify the script but my scripting knowledge is limited. I would like to modify (or use another script to control the other one) the script so anyone owning the wing could touch it to stop the flap and turn on and off when they want to stop the wings. Is this possible? If so can anyone help me with this? Thank you.
This is the script I have for my wings.
float counter;
integer stage = 0;
float wing_speed = 0.1;
float degrees_per_increment = 2;
default
{
state_entry()
{
llSetLinkPrimitiveParamsFast(2,[PRIM_ROT_LOCAL,llEuler2Rot(<180.0,0.0,0>*DEG_TO_RAD),PRIM_LINK_TARGET,3,PRIM_ROT_LOCAL,llEuler2Rot(<0.0,0.0,0>*DEG_TO_RAD)]);
llSetTimerEvent(wing_speed);
}
attach(key id)
{
if(id)
{
llResetScript();
}
}
timer()
{
if(stage == 0)
{
counter += degrees_per_increment;
if(counter >= 20)
{
stage = 1;
}
}
else if(stage == 1)
{
counter -= degrees_per_increment;
if(counter <= 0)
{
stage = 0;
}
}
llSetLinkPrimitiveParamsFast(2,[PRIM_ROT_LOCAL,llEuler2Rot(<180.0,0.0,counter>*DEG_TO_RAD),PRIM_LINK_TARGET,3,PRIM_ROT_LOCAL,llEuler2Rot(<0.0,0.0,counter>*DEG_TO_RAD)]);
}
}