innula

Untitled

Jan 24th, 2013
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   //--// v7-D Feebie Type 1 Door Script //--//
  2.   //--// Works At ANY Angle             //--//
  3.  // by Voic Singer
  4.  //-- works in ANY single prim door, linked or un-linked
  5.  //-- works in muti prim doors NOT linked to a larger structure
  6.  //-- REQUIREMENTS: a cut root prim, suggest cube, pathcut start=.125, end=.625
  7.  //-- CAVEAT: single prim doors are limited to 5m width
  8.  
  9.   //--// USERS MODIFY HERE v
  10.  integer vgIntDoorSwing = 90;
  11.  //-- use -# to reverse the direction of swing, eg. -90;
  12.  
  13.  
  14.  rotation vgRotDoorSwing;
  15.  
  16.  default{
  17.    state_entry(){
  18.      vgRotDoorSwing = llEuler2Rot( <.0, .0, (float)vgIntDoorSwing * DEG_TO_RAD> );
  19.    }
  20.  
  21.    touch_start( integer vIntTouches ){
  22.       //- small hack to reverse direction of swing on each
  23.       //- touch & avoid lsl funkiness regarding rotation division
  24.      vgRotDoorSwing.s *= -1;
  25.  
  26.      llSetLocalRot( vgRotDoorSwing * llGetLocalRot() );
  27.    }
  28.  }
  29.  
  30.  //-- IF Redistributing as-is:
  31.  //-- Please leave script full permissions & include all comments
Add Comment
Please, Sign In to add comment