Difference between revisions of "Multirezzer"

From Second Life Wiki
Jump to navigation Jump to search
m (<!--The code starts below here but does not include this text.-->)
m ({{LSLC|Library|Multirezzer}})
Line 1: Line 1:
The SL wiki does not format the <nowiki><code></nowiki> tag properly; therefore, I recommend you click "Edit" and copy-and-paste this code from the edit box (make sure you don't copy the nowiki tags).<br>
The SL wiki does not format the <nowiki><code></nowiki> tag properly; therefore, I recommend you click "Edit" and copy-and-paste this code from the edit box (make sure you don't copy the nowiki tags).<br>
==Description/Information==
Rezzes up to ten objects upon [[start_collision|collision]] with a user.


Rezzed (Spawned) objects can be a maximum of 10 meters away on any plane from the rez point.
Rezzed (Spawned) objects can be a maximum of 10 meters away on any plane from the rez point.
==Description==
Rezzes up to ten objects upon [[start_collision|collision]] with a user.


==Script==
==Script==
Line 83: Line 83:
<!--The code ends here but does not include this text.-->
<!--The code ends here but does not include this text.-->
</code>
</code>
{{LSLC|Library|Multirezzer}}

Revision as of 13:19, 21 May 2007

The SL wiki does not format the <code> tag properly; therefore, I recommend you click "Edit" and copy-and-paste this code from the edit box (make sure you don't copy the nowiki tags).

Description/Information

Rezzes up to ten objects upon collision with a user.

Rezzed (Spawned) objects can be a maximum of 10 meters away on any plane from the rez point.

Script

vector velocity; integer shot = FALSE; integer fade = FALSE; float alpha = 1.0;

default {

   state_entry()
   {
       llSetStatus(STATUS_DIE_AT_EDGE, TRUE);
   }
   
   on_rez(integer start_param)
   {
       llSetStatus(STATUS_DIE_AT_EDGE, TRUE);
       llSetBuoyancy(1.0);
       llCollisionSound("", 1.0);          //  Disable collision sounds
       velocity = llGetVel();
       float vmag;
       vmag = llVecMag(velocity);
       if (vmag > 0.1) shot = TRUE;
       llSetTimerEvent(0.0);
   }
   collision_start(integer num)
   {
       if (llDetectedType(0) & AGENT)
       {
          // llTriggerSound("frozen", 1.0);
           llRezObject(">:) invisible", llDetectedPos(0), ZERO_VECTOR, llGetRot(), 0);
               {
          integer i;
          for ( i=0; i<num; i++ ) {
              
              llRezObject( "Object", llGetPos()+<3,3,2>, <0,0,0>, <0,0,0,1>, i );
              llRezObject( "Object", llGetPos()+<-3,-3,2>, <0,0,0>, <0,0,0,1>, i );
              llRezObject( "Object", llGetPos()+<-3,3,2>, <0,0,0>, <0,0,0,1>, i );
              llRezObject( "Object", llGetPos()+<3,-3,2>, <0,0,0>, <0,0,0,1>, i );
                     
              llRezObject( "Object", llGetPos()+<-8,0,2>, <0,0,0>, <0,0,0,1>, i );
              llRezObject( "Object", llGetPos()+<8,0,2>, <0,0,0>, <0,0,0,1>, i );
              llRezObject( "Object", llGetPos()+<0,-8,2>, <0,0,0>, <0,0,0,1>, i );
              llRezObject( "Object", llGetPos()+<0,8,2>, <0,0,0>, <0,0,0,1>, i );
              
              llRezObject( "Object", llGetPos()+<0,0,9>, <0,0,0>, <0,0,0,1>, i );
              llRezObject( "Object", llGetPos()+<0,0,-9>, <0,0,0>, <0,0,0,1>, i )
              integer i;
          }}
       }
   }
   
   timer()
   {
       if (!fade)
       {
           if (shot)
           {
               llDie();       
           }
       }   
       else
       {
           llSetAlpha(alpha, -1);
           alpha = alpha * 0.95;  
           if (alpha < 0.1) 
           {
               llDie();
           }     
       }
   }

}