Changed Event Example: Difference between revisions

From OpenSimulator
Jump to navigationJump to search
imported>Ideia Boa
No edit summary
imported>Fritigern
No edit summary
Line 19: Line 19:
     }
     }
  }
  }
[[Category:Scripts]]

Revision as of 13:19, 19 November 2010

Code:

default {
   state_entry() {
       llSitTarget(<0, 0, 0.1>, ZERO_ROTATION); // needed for llAvatarOnSitTarget to work
   }
   
   changed(integer change) { // something changed
       if ((change & CHANGED_LINK) != 0) { // and it was a link change
          // llSleep(0.5); // llUnSit works better with this delay
           key av = llAvatarOnSitTarget();
           if (av != "") { // somebody is sitting on me
               llSay(0, "Get off!"); // say in chat when person is remove from prim
               
           }
       }
   }
}