//Linkable Multiprim Sliding Door -- Rolig Loon -- March 2011
// All prims in the door must be named "DOOR", and none can be the root prim of the linkset
integer gON = 1; // Change to -1 to reverse the direction of opening
float gDistance; // Adjust to set the distance the door should move long its local Y axis
default
{
touch_start(integer total_number)
{
if (llGetLinkName(llDetectedLinkNumber(0)) == "DOOR")
{
integer i;
for (i=2;i<=llGetNumberOfPrims();++i)
{
if (llGetLinkName(i) == "DOOR")
{
list temp = llGetLinkPrimitiveParams(i,[PRIM_POSITION,PRIM_ROT_LOCAL]);
rotation local_rot = (rotation)llList2String(temp,1);
vector local_pos = ((vector)llList2String(temp,0)- llGetPos())/llGetRot();
llSetLinkPrimitiveParamsFast(i,[PRIM_POSITION,local_pos + (<0.0,gDistance *gON,0.0>*local_rot),PRIM_ROTATION,local_rot/llGetRot()]);
}
}
gON = (-1)*gON;
}
}
}
This is really a bad script. The door has to be linked to the "root" prim. The movement and also position of the door, is related to the position of the root. So its almost impossible to find the right position of the door.