Jump to content

delete object after wearing


Heli Koba
 Share

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

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

Recommended Posts

hello all there,

i like to make some demo objects who are temporary wear and delets himself after timer Event.

like a hat, demoversion may wear by 5 minutes, them detach and delets himself out of inventory.

i try it with detache and temp,  . but dont worked.

haves anyone a idea to make that?

thanks for ideas      Heli

Link to comment
Share on other sites

ok ..  it work  ! with me! only.    if another touches the prim it attach correctly …  but detach is a scripterror ( perm faild )

default
{
    touch_start(integer num_touches)
    {
        llRequestPermissions( llDetectedKey(0), PERMISSION_ATTACH );
    }
 
    run_time_permissions( integer vBitPermissions )
    {
        if( vBitPermissions & PERMISSION_ATTACH )
        {
            llAttachToAvatarTemp( ATTACH_RHAND );
        llSleep(300.0);  //= 5 minutes
        llSay(0,"That was good. !");
        llDetachFromAvatar( );
        }
    }
 
    on_rez(integer rez)
    {
        if(!llGetAttached())
        { //reset the script if it's not attached.
            llResetScript();
        }
    }
}

Link to comment
Share on other sites

I would recommend that you also check that the target agent has available attach slots using the llGetObjectDetails() constant OBJECT_ATTACHED_SLOTS_AVAILABLE before attempting to temp attach else if temp attaching fails due to no slots available, the object will not attach, the object ownership will change and the new owner can take the object into their inventory and attach it whenever they want.

  • Like 1
Link to comment
Share on other sites

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