Modified Hypergate to level four.lsl 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // :SHOW:1
  2. // :CATEGORY:Hypergate
  3. // :NAME:Hypergate when you fall in
  4. // :AUTHOR:Ferd Frederix
  5. // :KEYWORDS:Game, conteoller
  6. // :REV:5.5
  7. // :WORLD:OpenSim, Second life
  8. // :DESCRIPTION:
  9. // requires oSTeleport functions to be enabled
  10. // :CODE:
  11. //hop://www.outworldz.com:9000/Hypergrid Story Five/191/160/22
  12. // Hypergate script by Ferd Frederix
  13. vector LandingPoint ; // from the desscription
  14. string DestName = "Hypergrid Story Five"; // Where you want the Avatar to arrive at
  15. vector LookAt = <0.0,0.0,-1.0>; // which way you want them facing.
  16. list LastFewAgents;
  17. string TargetAddress ; // In-Grid Teleport (Region Na
  18. PerformTeleport( key AgentToTP )
  19. {
  20. integer CurrentTime = llGetUnixTime();
  21. integer AgentIndex = llListFindList( LastFewAgents, [ AgentToTP ] ); // Is the agent we're teleporting already in the list?
  22. if (AgentIndex != -1) // If yes, check to make sure it's been > 5 seconds
  23. {
  24. integer PreviousTime = llList2Integer( LastFewAgents, AgentIndex+1 ); // Get the last time they were teleported
  25. if (PreviousTime >= (CurrentTime - 5)) return; // Less than five seconds ago? Exit without teleporting
  26. LastFewAgents = llDeleteSubList( LastFewAgents, AgentIndex, AgentIndex+1); // Delete the agent from the list
  27. }
  28. LastFewAgents += [ AgentToTP, CurrentTime ]; // Add the agent and current time to the list
  29. osTeleportAgent( AgentToTP, TargetAddress, LandingPoint, LookAt ); // Teleport agent to their target
  30. LastFewAgents = llDeleteSubList( LastFewAgents, 20, 100); // Delete the agent from the list
  31. }
  32. RESET_VOL_DET()
  33. {
  34. llVolumeDetect( 0 ); // turn off volume detection
  35. llVolumeDetect( 1 ); // turn it back on again
  36. }
  37. default
  38. {
  39. on_rez(integer int)
  40. {
  41. llResetScript();
  42. }
  43. state_entry()
  44. {
  45. llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
  46. LandingPoint = (vector) llGetObjectDesc();
  47. TargetAddress = DestName;
  48. RESET_VOL_DET();
  49. }
  50. link_message(integer n, integer v,string text, key id ) // total_number is the number of avatars detected.
  51. {
  52. // llOwnerSay("link:" + (string) v);
  53. if (v == -1 ) {
  54. // llOwnerSay("Teleport");
  55. llSetTimerEvent(30);
  56. }
  57. }
  58. timer()
  59. {
  60. llSay(0, "You follow the cyberbeings into another dimension..... to " + DestName);
  61. TargetAddress = DestName;
  62. // PerformTeleport( llDetectedKey( 0 ));
  63. llSetTimerEvent(0);
  64. }
  65. changed(integer change) // something changed, take action
  66. {
  67. if(change & CHANGED_OWNER)
  68. {
  69. llOwnerSay("Owner Changed, Resetting Script");
  70. llResetScript();
  71. }
  72. else if (change & CHANGED_REGION_START) // that bit is set during a region restart
  73. {
  74. llResetScript();
  75. }
  76. }
  77. }