From Second Life Wiki
Revision as of 15:42, 17 September 2007 by Xaviar Czervik (Talk | contribs)

Jump to: navigation, search


Event: attach( key <span title="the avatar if attached, if not attached NULL_KEY." style="border-bottom:1px dotted; cursor:help;">id ){ ; }</span>

Triggered when an object attaches or detaches from agent.

• key id the avatar if attached, if not attached NULL_KEY.


The following is a simplified example of the attach event. As explained above the variable id will be the key of the avatar the scripted object is attached to otherwise it will take on the value of NULL_KEY. The conditional if statement is used to determine if the value of the variable id.

    attach(key id)
        if(id)//tests if it is a valid key and not NULL_KEY
            llSay(0,"I have been attached!");
            llSay(0,"I have been detached!");

See Also

Deep Notes


event void attach( key id );