Difference between revisions of "No Auto-Return"

From Second Life Wiki
Jump to navigation Jump to search
m (improved readability and fixed a few errors)
m (added LSL Tip)
Line 5: Line 5:
[[Image:Bella_003.jpg|thumb|My cube has been here for 4 hours!]]
[[Image:Bella_003.jpg|thumb|My cube has been here for 4 hours!]]


Note: Only use for long builds that will take a long time; NOTHING ELSE!!!
Note: Only use for long builds that will take a long time; NOTHING ELSE!
Note 2: Only works in single prims.
 
== Let's see the script then! ==
 
Okay, here we go :D.


== Example script ==
{{LSL Tip|Do take note that this script is meant for single-prim-objects, '''NOT''' linksets!}}
<lsl>
<lsl>
key owner;
key owner;

Revision as of 13:21, 18 October 2012

What is No Auto-Return?

Isn't it annoying when you're at a sandbox and you haven't linked a build and you get frustrated because it gets returned and you can't work out where that bit goes again? Well, with this script it stops the objects from getting returned!

My cube has been here for 4 hours!

Note: Only use for long builds that will take a long time; NOTHING ELSE!

Example script

KBcaution.png Important: Do take note that this script is meant for single-prim-objects, NOT linksets!

<lsl> key owner;

default {

   on_rez(integer param)
   {
       key ownerRightNow = llGetOwner();
       if (owner == ownerRightNow)
           llRequestPermissions(owner, PERMISSION_CHANGE_LINKS);
       else
           llResetScript();
   }
   changed(integer change)
   {
       if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
           llResetScript();
   }
   state_entry()
   {
       owner = llGetOwner();
       llRequestPermissions(owner, PERMISSION_CHANGE_LINKS);
       llListen(10240, "", NULL_KEY, "");
   }
   listen(integer channel, string name, key id, string message)
   {
       llDie();
   }
   run_time_permissions(integer perm)
   {
       if(perm & PERMISSION_CHANGE_LINKS)
           llSetTimerEvent(30.0);
   }
   timer()
   {
       key keyThisPrim = llGetKey();
       integer link = llGetLinkNumber();
       llBreakLink(link);
   //  wait a bit to make sure this works
       llSleep(5.0);
       llCreateLink(keyThisPrim, FALSE);
   }

} </lsl>