Phantom Child

From Second Life Wiki
Revision as of 17:00, 5 April 2009 by Strife Onizuka (talk | contribs) (→‎Phantom Child: Using GetPrimitiveParams is overkill in this case (so I simplified it out), but thanks for the props =^_^=)
Jump to navigation Jump to search

Phantom Child

This easy to use code when put into a child prim of a linkset will make thay child and only that child phantom, even when taken into inventory and re-rezzed. You can use multiple copies of this script to make multiple children of a linkset phantom.

This code relies on a bug in Secondlife and may not function in later versions (currently server version 1.24). This script was created in part by Aeron Kohime and documents this useful bug (which like invis-prims, has countless applications).

You may use the follow script in any manner you like, excluding claiming you made it and individually reselling it without change in function (its on the wiki silly). Otherwise you can sell it as part of a product, modify it, remove my comments, etc etc.

<lsl> //Phantom Child Script by Aeron Kohime //WARNING: When used on the root prim it makes the entire object phantom, it // also does not function correctly on tortured prims. (Sorry.) //Reset on Sim restart added by Void Singer

default {

   state_entry() {
       list prim = PRIM_TYPE + llGetPrimitiveParams([PRIM_TYPE]);
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX,
           0, <0,1,0>, 0, <0,0,0>, <1,1,0>, <0,0,0>,
           PRIM_FLEXIBLE, TRUE, 0, 0, 0, 0, 0, <0,0,0>] + prim);
   }
   on_rez(integer s) {
       llResetScript();
   }
   changed (integer vBitChanges){
       if (CHANGED_REGION_START & vBitChanges){
           llResetScript();
       }
   }

} </lsl>