Jump to content

Recommended Posts

Hello guys! I'm looking for a unpack script only work with HUD "click to unpack" or when the object or hud is worn automatically send the content or folder and detach seconds later. If the object or hud is rezzed automatically is deleted.
Where can i find? In markeplace are not modify, no custom or dont have all options

 

Link to post
Share on other sites

http://wiki.secondlife.com/wiki/LlGiveInventoryList

^^ a few good ones there, you could change it a bit to suit your taste, perhaps chage touch_stert to on_rez, and add both llDie() and llDetach() to the end of the event to cover the case where it's rezzed in-world and the case when it's attached.

Link to post
Share on other sites

In order to detach automatically, the object needs to ask for permissions. So this would present the wearer with an additional dialogue. That's why you barely see an unpack HUD that detaches automatically. 

Unpack-on-wear is relatively easy, as is unpack-on-rez. With unpack-on-rez you can have the object auto-delete as well.

Link to post
Share on other sites
1 hour ago, Peter Stindberg said:

In order to detach automatically, the object needs to ask for permissions. So this would present the wearer with an additional dialogue. That's why you barely see an unpack HUD that detaches automatically. 

Unpack-on-wear is relatively easy, as is unpack-on-rez. With unpack-on-rez you can have the object auto-delete as well.

Permission to attach/detach is automatically granted without a permission prompt if the script is already attached to the avatar.

  • Like 1
Link to post
Share on other sites
25 minutes ago, Peter Stindberg said:

Well, I tried exactly that the other day, and got an error message about missing permissions on auto-detach.

 

list get_contents_except_self()
{
    list contents;

    string self = llGetScriptName();
    integer item = llGetInventoryNumber(INVENTORY_ALL);
    while (~--item)
    {
        string name = llGetInventoryName(INVENTORY_ALL, item);
        if (name != self)
        {
            contents += name;
        }
    }

    return (contents);
}

default
{
    attach(key id)
    {
        if (id) llRequestPermissions(id, PERMISSION_ATTACH);
    }

    run_time_permissions(integer perm)
    {
        if (perm)
        {
            key avatar = llGetPermissionsKey();
            llGiveInventoryList(avatar, "TEST CONTENT", get_contents_except_self());
            llRegionSayTo(avatar, 0, "Got permission to detach, bye!");
            llDetachFromAvatar();
        }
    }
}

 

Edited by Wulfie Reanimator
  • Like 4
Link to post
Share on other sites
1 hour ago, Wulfie Reanimator said:

attach(key id) { if (id) llRequestPermissions(id, PERMISSION_ATTACH); }

OK, the difference between your script and mine was that I did not have that line in it. Will try it later. Thanks 🙂

Update: Yep, works now. Thanks again!

Edited by Peter Stindberg
Successfully tested
  • Like 1
Link to post
Share on other sites
On 4/4/2021 at 8:13 AM, Wulfie Reanimator said:

Permission to attach/detach is automatically granted without a permission prompt if the script is already attached to the avatar.

 

On 4/4/2021 at 8:24 AM, Peter Stindberg said:

Well, I tried exactly that the other day, and got an error message about missing permissions on auto-detach.

The key detail that was missing on the first comment, and the following example is:

Yes, the permission to attach/detach is automatically granted in this type of situation w/out generating a permission prompt, but you still have to ask for it before you try otherwise the system complains (throws an error).

  • Thanks 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...