Jump to content

group only script


JulieAnne Rau
 Share

You are about to reply to a thread that has been inactive for 1494 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

So have this script that works great for a rope climb but I want to make it group only... I know it has something to do with this.. 

if ( llSameGroup( llDetectedKey(0) ) )

but I'm not sure where it fits in the script, can someone give me a kick in the pants and get me going?

------------------------------------------------------------

float LADDERHEIGHT= 6.0;    // how far to move up
float STEPHEIGHT = 0.25;    // how far to move each step
float OFFSET = 0;           // tilt
float Extra  = -2;           // extra move onto the roof
  
 climbup()
 {
    
          llSetAlpha(0,ALL_SIDES);
          llStopAnimation("sit");
          llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
       
      
     integer i;
     vector original;
     float steps = LADDERHEIGHT / STEPHEIGHT;
     float offset = OFFSET / steps;  // to one side
     
     original = llGetPos();
     do    
     {
         i++;  
         vector newPos = llGetPos() + <offset,0, STEPHEIGHT> * llGetRot();
         llSetPos(newPos);
     } while(i <= (steps));
 
     llSetPos(llGetPos() + <Extra, 0, 0> * llGetRot()); // extra, then unsit
     
     llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
 
     if(llAvatarOnSitTarget() != NULL_KEY)
     { // somebody is sitting on me
         llUnSit(llAvatarOnSitTarget()); // unsit him or her
     }
       
     llSetRegionPos(original); 
     llSetAlpha(1,ALL_SIDES);
 }  // end climbup
 
 default
 {
   
   state_entry() {
      llSitTarget(<0.50, 0.0, 0.1>, ZERO_ROTATION);
   }
 
   changed(integer change)
   { 
     if(change == CHANGED_LINK)
     {
       key avatar = llAvatarOnSitTarget();
      
       if(avatar != NULL_KEY)
       {
          llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION);
          climbup();
       } 
     }
   } //end changed
 } //end default

Link to comment
Share on other sites

That's not all that's missing.  Your script is missing an entire event:

float LADDERHEIGHT= 6.0;    // how far to move up
float STEPHEIGHT = 0.25;    // how far to move each step
float OFFSET = 0;           // tilt
float Extra  = -2;           // extra move onto the roof
  
 climbup()
 {
    
          llSetAlpha(0,ALL_SIDES);
          llStopAnimation("sit");
          llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
       
      
     integer i;
     vector original;
     float steps = LADDERHEIGHT / STEPHEIGHT;
     float offset = OFFSET / steps;  // to one side
     
     original = llGetPos();
     do    
     {
         i++;  
         vector newPos = llGetPos() + <offset,0, STEPHEIGHT> * llGetRot();
         llSetPos(newPos);
     } while(i <= (steps));
 
     llSetPos(llGetPos() + <Extra, 0, 0> * llGetRot()); // extra, then unsit
     
     llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
 
     if(llAvatarOnSitTarget() != NULL_KEY)
     { // somebody is sitting on me
         llUnSit(llAvatarOnSitTarget()); // unsit him or her
     }
       
     llSetRegionPos(original); 
     llSetAlpha(1,ALL_SIDES);
 }  // end climbup
 
 default
 {
   
   state_entry() {
      llSitTarget(<0.50, 0.0, 0.1>, ZERO_ROTATION);
   }
 
   changed(integer change)
   { 
     if(change == CHANGED_LINK)
     {
       key avatar = llAvatarOnSitTarget();
       if(avatar != NULL_KEY)
       {
           if ( llSameGroup(avatar) )
           {
           
               if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)
               {
                   climbup();
               }
               else
               {
                   llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION);
               }
           }
        }
     }
   } //end changed
           
   run_time_permissions (integer perm)
   {
      if (perm & PERMISSION_TRIGGER_ANIMATION)
      {
           climbup();
      }
   }  // end run_time_permissions
           
 } //end default

 

Edited by Rolig Loon
Ooops
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1494 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...