////////////////////////////////////////////////////// //KDC Multi door system, CC-BY-SA // // // //By: Kyrah Abattoir // // // //Purpose: allow you to control many doors from a // //single core script, complete with sound projectors// //and name based access control! // // // //This is a free software offered with no warranty. // ////////////////////////////////////////////////////// string sound_to_play = "my door sound";// put your sound name/key here vector int2vec(integer n) { //0zyx ZZZZ ZZZZ ZZZZ YYYY YYYY XXXX XXXX return >8)&0xFF, ((n>>16)&0xFF)> + <((n&0x10000000)!=0)*.5,((n&0x20000000)!=0)*.5,((n&0x40000000)!=0)*.5>; } default { state_entry() { llSetStatus(STATUS_PHANTOM, TRUE); llSetPrimitiveParams([PRIM_TEMP_ON_REZ, TRUE]); } on_rez(integer a) { //on rez, we decode the destination from the a parameter. if(a == 0) return; vector destination = int2vec(a); //move to destination integer i; for(i=0 ; i<50 && (llGetPos() != destination) ; i++) llSetPos(destination); //play sound if(llGetPos() == destination) llTriggerSound(sound_to_play,1.0); //And disappear! llDie(); } }