This is a nice script for adding drawer functionality to any prim.
//FREE SCRIPTS - TESTED AND WORKING ON KITELY
// If you paid for this script, you were ripped off.
// You may use in your creations.
// You may not sell it as a script or in a script collection.
// Copy and paste the contents of this notecard into a new script.
integer lClosed=TRUE;
// Reverse the Polarity of Open and Close (Switching the "+" and "-") if the Drawer goes in the Wrong Direction
close() {
llSetPos(llGetLocalPos()+(<0.0, 0.0, 0.60>)*llGetLocalRot());
lClosed=TRUE;
}
open() {
llSetPos(llGetLocalPos()-(<0.0, 0.0, 0.60>)*llGetLocalRot());
lClosed=FALSE;
}
default
{
touch_start(integer total_number)
{
if (lClosed) {
open();
llSetTimerEvent(30);
} else {
close();
}
}
timer() {
if (lClosed==FALSE) {
close();
}
llSetTimerEvent(0);
}
}