// V3 // float auto_close = 10.0; // The time the door remains open before auto closing. Set to zero for no auto closure. integer open; OperateDoors() { if(!open) { float f = 0.0; while((f += 0.01) <= 1.0) llSetLinkPrimitiveParamsFast(LINK_THIS, [9, 0, 0, <0.375,0.875,0.0>, 0.95, ZERO_VECTOR, <f,1.0,0.0>, ZERO_VECTOR]); } else { float f = 1.0; while((f -= 0.01) >= -1.0) llSetLinkPrimitiveParamsFast(LINK_THIS, [9, 0, 0, <0.375,0.875,0.0>, 0.95, ZERO_VECTOR, <f,1.0,0.0>, ZERO_VECTOR]); } llSetTimerEvent(auto_close); open = (!open); } default { state_entry() { vector pos = llGetPos(); llSetLinkPrimitiveParamsFast(LINK_THIS, [9, 0, 0, <0.375,0.875,0.0>, 0.95, ZERO_VECTOR, <0.0,1.0,0.0>, ZERO_VECTOR, 17, -1, TEXTURE_BLANK, <1.0,1.0,0.0>, ZERO_VECTOR, 0.0, 6, <pos.x,pos.y,(pos.z - 0.25)>, 18, -1, ZERO_VECTOR, 0.4, 8, <PI,0.0,0.0,PI>, 7, <3.0,5.0,0.01>]); } touch_start(integer nd) { if(llToLower(llGetObjectDesc()) == "owner") { while(nd) { if(llDetectedKey(--nd) == llGetOwner()) OperateDoors(); } } else OperateDoors(); } timer() { llSetTimerEvent(0.0); if(open) OperateDoors(); } }
Need to write a LSL script and don't know how to script? I know I hate trying to get my head around LSLS when I an in a time crunch. So why not give Flash Scratch a try! Its a great tool for learning and scoding your own scripts for Second Life without having to pay someone to do it and without a crash course in LSL
A Huge thanks to John Bennet of ATLAS Institute at University of Colorado and Eric Rosenbaum at MIT for writing Scratch for SL to begin with.