Jump to content

A HUD to detect when a wearable item is detached


forensixpert
 Share

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

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

Recommended Posts

I am working on a specific HUD for a collection of different items and i would like the HUD's status indicators update when a piece is attached (worn-added) and when they are detached. I have sorted the attach portion but trying to find ideas to detect when an item from the collection is detached form the avatar.

Any hints or directions you can suggest?

Thanks a bunch in advance

Link to comment
Share on other sites

Assuming you're using the attach event to detect when the item is attached, you can also use it to detect when it's detached: in this case the key id parameter is NULL_KEY, as opposed to the key of the avatar to which it is attaching to.

A couple of lines of code will be (fairly reliably) executed when the item is detached. Note that any code not executed will be then be executed when the item is reattached before the attach event is triggered again.

  • Like 1
Link to comment
Share on other sites

attach(key ID)
{   if(ID)
    {   llSay(channel,"I have been attached");
    }else
    {   llSay(channel,"I have been detached");
    }
}

from the attachment, otherwise, you'd have to loop through llGetAttachedList() on a timer.

Edited by Quistess Alpha
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 487 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...