
here is the script if anyone can help.
i had to put spaces on either side of the < and > in the openRot line of the script because it was causeing a 404 error when posting
float openingTime=2.0; // in seconds
float openingAngle=45.0; // in degrees
float autocloseTime=5.0; // in seconds
float omega=0.0;
vector axis;
rotation closedRot;
rotation openRot;
integer swinging;
integer open;
openDoor(integer yes)
{
vector useAxis=axis;
open=yes;
if(!yes)
useAxis=-axis;
llSetTimerEvent(openingTime);
llTargetOmega(useAxis,omega,1.0);
}
default
{
state_entry()
{
swinging=FALSE;
open=FALSE;
omega=TWO_PI/360*openingAngle/openingTime;
llTargetOmega(ZERO_VECTOR,1.0,1.0);
}
touch_start(integer dummy)
{
if(!swinging)
{
if(!open)
{
axis=llRot2Fwd(llGetLocalRot());
closedRot=llGetLocalRot();
openRot=llEuler2Rot( < openingAngle,0.0,0.0 > *DEG_TO_RAD)*closedRot;
}
swinging=TRUE;
openDoor(!open);
}
}
timer()
{
if(swinging)
{
swinging=FALSE;
llTargetOmega(axis,0.0,0.0);
if(open)
{
llSetLocalRot(openRot);
llSetTimerEvent(autocloseTime);
}
else
{
llSetLocalRot(closedRot);
llSetTimerEvent(0.0);
}
}
else
{
llSetTimerEvent(0.0);
openDoor(!open);
swinging=TRUE;
}
}
}
