Heli Koba Posted August 23, 2018 Share Posted August 23, 2018 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 More sharing options...
KT Kingsley Posted August 23, 2018 Share Posted August 23, 2018 You can't delete an object from the inventory with a script. Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted August 23, 2018 Share Posted August 23, 2018 You could have a vendor in your store rez it and temp attach to a customer and detach after # minutes. Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 23, 2018 Share Posted August 23, 2018 That's exactly what the llAttach2AvatarTemp function is designed for. Read all about it in the LSL wiki. Link to comment Share on other sites More sharing options...
Heli Koba Posted August 23, 2018 Author Share Posted August 23, 2018 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 More sharing options...
KT Kingsley Posted August 23, 2018 Share Posted August 23, 2018 Permissions are reset when an object changes ownership, which happens when the object gets attached. You must request permission to detach from the new owner once it's been attached. Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 23, 2018 Share Posted August 23, 2018 Pay attention to the script examples in the LSL wiki for that function. They show you how it's done. Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted August 25, 2018 Share Posted August 25, 2018 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. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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