Jump to content
Bull Vita

llGetUsername(llDetectedKey(0)) working on attach(key id) ?

Recommended Posts

Hello everyone,

I'm trying to script an object that will say something with the Name of whom attach that object....Example:

default
{
    attach(key id)
    {
        if (id)     
        {
            llSay(0, "I have been attached!" + llGetDisplayName(llDetectedKey(0)));
        }
        else
        {
            llSay(0, "I have been detached!" + llGetDisplayName(llDetectedKey(0)));
        }
    }
}

 

But that won't work on attach....  is there a way that I can make it work?

Thanks for the help!

Share this post


Link to post
Share on other sites

Yeah, the attach event doesn't bind the llDetected* values, but a common approach is to use llGetOwner() instead because an attachment is always owned by the agent to whom it's attached.

(That's not necessarily a good thing, especially because it means temp-attached objects must be transferable, but it's unlikely to change because so much depends on it now.)

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...