User:ANSI Soderstrom/Where i come from

From Second Life Wiki
< User:ANSI Soderstrom
Revision as of 12:13, 26 February 2010 by ANSI Soderstrom (talk | contribs) (Created page with '<lsl> // Where i come from ??? // (C) 02/2010 by ANSI Soderstrom // Rezz me from a Object with a integer > 0 integer DEBUG = TRUE; integer DEFAULTSTATE; default { state_ent...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<lsl> // Where i come from ??? // (C) 02/2010 by ANSI Soderstrom // Rezz me from a Object with a integer > 0

integer DEBUG = TRUE; integer DEFAULTSTATE;

default {

   state_entry() {
       if(DEBUG && !DEFAULTSTATE) {
           llWhisper(0,"I am already an in-world living object (ScriptReset or ObjectCopy)");
           // Your Code here
       }
       DEFAULTSTATE=TRUE;
       state RezFromInventory;
   }

}

state RezFromObject {

   state_entry() { 
       if(!DEFAULTSTATE) {
           // Your Code here
       }
   }

}

state RezFromInventory {

   state_entry() {  
       if(DEFAULTSTATE) { 
           // Your Code here
       }
   }
       
   on_rez(integer i) {  
       DEFAULTSTATE=FALSE;
       if(i) {
           if(DEBUG) {
               llWhisper(0,"Rezzed from Object");
           }
           state RezFromObject;
       } else {
           if(DEBUG) {
               llWhisper(0,"Rezzed from Inventory");
           }
           state RezFromInventory;
       }
   }  

} </lsl>