Advertisement
Pinksamurai

Teleport in the same sim

Jan 31st, 2022 (edited)
2,350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Problem : very old and doesn't work for more than 300 meters or less. Better uese llSetRegionPos
  2.  
  3. vector targetPos = <137.0,143.0,1100.0>; //The target location
  4.  
  5. reset()
  6. {
  7.     vector target;
  8.    
  9.     target = (targetPos- llGetPos()) * (ZERO_ROTATION / llGetRot()); //to change from global to local. zero rotation is actually equal to 1
  10.     llSitTarget(target, ZERO_ROTATION);
  11.     llSetSitText(llGetObjectName());
  12. }
  13. default
  14. {
  15.     state_entry()
  16.     {
  17.         reset();
  18.     }
  19.    
  20.     on_rez(integer startup_param)
  21.     {
  22.         reset();
  23.     }
  24.    
  25.     changed(integer change)
  26.     {
  27.         llUnSit(llAvatarOnSitTarget());
  28.         reset();
  29.     }    
  30. }
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement