Changed Event Example
From OpenSimulator
(Difference between revisions)
Line 1: | Line 1: | ||
'''Code:''' | '''Code:''' | ||
− | + | default { | |
− | + | ||
− | default { | + | |
state_entry() { | state_entry() { | ||
llSitTarget(<0, 0, 0.1>, ZERO_ROTATION); // needed for llAvatarOnSitTarget to work | llSitTarget(<0, 0, 0.1>, ZERO_ROTATION); // needed for llAvatarOnSitTarget to work | ||
Line 18: | Line 16: | ||
} | } | ||
} | } | ||
− | } | + | } |
Revision as of 18:15, 16 January 2008
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(); llSay(0,(string)av); if (av != "") { // somebody is sitting on me llSay(0, "Get off!"); // say in chat when person is remove from prim } } } }