Attach/ja

From Second Life Wiki
< Attach
Revision as of 19:10, 16 January 2008 by Asuka Neely (talk | contribs)
Jump to navigation Jump to search

Description

Event: attach( key id ){ ; }

オブジェクトがエージェントに装着もしくは取り外す時に作動します。

• key id 装着されていたなら該当アバタ、装着されていなかった場合にはNULL_KEY

Examples

以下はattachイベントの簡易例です。 上の変数idからNULL_KEY以外のアバターのキーを受け取ったときに、用意されたオブジェクトが装着される、という説明です。ifステートメントの状態は変数idの値によって決定するものが用いられます。

<lsl>default {

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

}</lsl>

See Also

Functions

• llAttachToAvatar
• llDetachFromAvatar
• llGetAttached

Articles

• Attachment/ja

Deep Notes

Signature

event void attach( key id );