Advertisement
Guest User

Untitled

a guest
Nov 11th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. vector homepos;
  2. rotation homerot;
  3. list points;
  4. list rots;
  5. key av = NULL_KEY;
  6. integer tp;
  7. integer line;
  8. default
  9. {
  10. state_entry()
  11. {
  12. homepos = llGetPos();
  13. homerot = llGetRot();
  14. llSitTarget(<0,0,0.1>, ZERO_ROTATION);
  15. llForceMouselook(1);
  16. if(llGetInventoryNumber(INVENTORY_NOTECARD) > 0) llGetNotecardLine(llGetInventoryName(INVENTORY_NOTECARD, 0), line);
  17. }
  18.  
  19. changed(integer c)
  20. {
  21. if(c&CHANGED_LINK)
  22. {
  23. av = llAvatarOnSitTarget();
  24. if(av != NULL_KEY)
  25. {
  26. if(points != []) llSetRegionPos((vector)llList2Vector(points,tp));
  27. if(rots != []) llSetRot((rotation)llList2Rot(rots,tp)); // sleep on this helps
  28. llUnSit(av);
  29. //llTriggerSound("cfc3f5be-0a6a-0d36-5b7e-c5c040275037",1);
  30. llSetRot(homerot); // for the sleep
  31. llSetRegionPos(homepos);
  32. tp++;
  33. if(tp >= llGetListLength(points)) tp = 0;
  34. }
  35. }
  36. else if(c&CHANGED_INVENTORY)
  37. {
  38. if(llGetInventoryNumber(INVENTORY_NOTECARD) > 0)
  39. {
  40. points = [];
  41. rots = [];
  42. line = 0;
  43. llGetNotecardLine(llGetInventoryName(INVENTORY_NOTECARD, 0), line);
  44. }
  45. }
  46. else if(c&CHANGED_REGION_START) llResetScript();
  47. }
  48.  
  49. dataserver(key id, string d)
  50. {
  51. if(d != "")
  52. {
  53. list data = llCSV2List(d);
  54. points += [(vector)llList2String(data,0)];
  55. rots += [(rotation)llList2String(data,1)];
  56. line++;
  57. llGetNotecardLine(llGetInventoryName(INVENTORY_NOTECARD, 0), line);
  58. }
  59. else
  60. {
  61. llOwnerSay((string)llGetListLength(points) + " teleports loaded");
  62. tp = llAbs(llRound(llFrand(llGetListLength(points)))-1);
  63. }
  64. }
  65.  
  66. on_rez(integer sp)
  67. {
  68. llResetScript();
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement