Pinksamurai

Elevator

Nov 23rd, 2018 (edited)
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. vector gFloor;
  2. vector 1Floor;
  3. vector cPos;
  4. float gY = gFloor.y;
  5. float gX = gFloor.x;
  6. float gZ = gFloor.z;
  7. float 1Z = gZ + 10;
  8.  
  9. default
  10. {
  11.     state_entry ()
  12.     {
  13.         gFloor = llGetPos();
  14.         1Floor = <gX, gY, 1Z>;
  15.     }
  16.    changed(integer change)
  17.     {
  18.        
  19.        if(change & CHANGED_LINK)
  20.        {
  21.            cPos = llGetPos;
  22.            if (cPos == gFloor)
  23.            {
  24.            llSleep (2.0);
  25.            llSetRegionPos(1Floor);
  26.             }
  27.  
  28.            else
  29.            {
  30.                llSetRegionPos(gFloor);
  31.             }
  32.          }
  33.     }
  34.  
  35.    
  36. }
Add Comment
Please, Sign In to add comment