Difference between revisions of "Attach/ja"

From Second Life Wiki
Jump to navigation Jump to search
Line 13: Line 13:
|examples=
|examples=
以下はattachイベントの簡易例です。
以下はattachイベントの簡易例です。
上の変数idから{LSL_Constant/NULL_KEY}}以外のアバターのキーを受け取ったときに、用意されたオブジェクトが装着される、という説明です。
上の変数idから{LSL_Constant/NULL_KEY}}以外のアバターのキーを受け取ったときに、用意されたオブジェクトが装着される、という説明です。ifステートメントの状態は変数idの値によって決定するものが用いられます。


<lsl>default
<lsl>default

Revision as of 19:07, 16 January 2008

Description

Event: attach( key id ){ ; }

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

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

Examples

以下はattachイベントの簡易例です。 上の変数idから{LSL_Constant/NULL_KEY

Deep Notes

Signature

event void attach( key id );

以外のアバターのキーを受け取ったときに、用意されたオブジェクトが装着される、という説明です。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> |helpers |also_header |also_events |also_functions= |-style="vertical-align:top;" | style="color:gray;" |• llAttachToAvatar | | style="color:gray;" | | | |-style="vertical-align:top;" | style="color:gray;" |• llDetachFromAvatar | | style="color:gray;" | | | |-style="vertical-align:top;" | style="color:gray;" |• llGetAttached | | style="color:gray;" | | | |also_articles= |-style="vertical-align:top;" | style="color:gray;" |• Attachment/ja | | style="color:gray;" | | | |also_footer |notes |mode |deprecated |cat1=Attachment/ja |cat2 |cat3 |cat4}}