Advertisement
skidzt

Super simple teleport/magic door script

Oct 23rd, 2016
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Put the destination in the description of the object
  2. float waittime = 0.1;
  3. integer unsitting = FALSE;
  4. default
  5. {
  6.     state_entry()
  7.     {
  8.         llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION);
  9.         llSetMemoryLimit(llRound((float)llGetUsedMemory() * 1.2));
  10.     }
  11.    
  12.     changed(integer change)
  13.     {
  14.         if(change & CHANGED_LINK)
  15.         {
  16.             key av = llAvatarOnSitTarget();
  17.             if (av)
  18.             {
  19.                 vector mypos = llGetPos();
  20.                 if (ZERO_VECTOR == (vector)llGetObjectDesc())
  21.                     llOwnerSay("You need to set the position in the descrition of the object.");
  22.                 else
  23.                 {
  24.                     llSetRegionPos((vector)llGetObjectDesc());
  25.                     llSleep(waittime);
  26.                 }
  27.                 llUnSit(av);
  28.                 llSleep(waittime);
  29.                 llSetRegionPos(mypos);
  30.                 unsitting = TRUE;
  31.             }
  32.             else if (unsitting == FALSE)
  33.                 llOwnerSay("Don't link me to anything!");
  34.             else
  35.                 unsitting = FALSE;
  36.         }
  37.         else if (change & CHANGED_REGION_START)
  38.         {
  39.             llSetMemoryLimit(llRound((float)llGetUsedMemory() * 1.2));  
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement