Jump to content

Attach object when gesture is played.


Avatou
 Share

You are about to reply to a thread that has been inactive for 1326 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Generally speaking, getting a script to react to a gesture is easy enough. One approach is to use a listen event where the script is listening for a specific keyword on a specific channel from a specific source. For example, put the following scrip into a prim

default
{
    state_entry()
    {
        llListen(-5,"",llGetOwner(),"ping");
    }
    
    listen(integer channel, string name, key uuid, string msg)
    {
        llOwnerSay("heard keyword '" + msg + "' from "+ llKey2Name(uuid) + " on channel "+(string)channel);
    }
}

Then create a custom gesture that has this for the chat to say:

/-5ping

When you trigger that gesture, it will speak the work "ping" on channel -5. This won't show up in local chat (because we used a negative channel number), but the scripted object from above will hear that as long as it's within normal chat range to you (since the gesture technically speaks through you). When the script hears this, it will speak its own diagnostic chat directly to you via llOwnerSay().

Building upon that, you can use either llAttachToAvatar() or llAttachToAvatarTemp() in place of the llOwnerSay() from the above example to attach the object to your avatar. See their respective wiki pages for info on how to use them. And be aware that you will nee to ensure that the object has permission to attach in the first place. So you will need to request the permissions prior to attempting to attach. This is also explained in the linked wiki pages.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1326 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...