Zeldaboy111

Create teleport sign ]|[ Skript #399

Mar 18th, 2021
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.52 KB | None | 0 0
  1. #- Reselling/Reuploading while claiming that it is yours or made by you is disallowed
  2. #- Do not edit it and upload it as your own
  3. #- While using it in a video, please feature everything under "Video"
  4. #
  5. #Video:
  6. #Skript made by Zeldaboy111
  7. #More content of the creator: https://forums.skunity.com/search/26443679/
  8. options:
  9. logo: &d&lT&5&lS&8:&7
  10.  
  11. command /teleportsign [<text>] [<text>] [<text>] [<text>] [<text>] [<text>] [<text>]:
  12. aliases: tpsign
  13. trigger:
  14. if arg-1 is "create":
  15. if target block of player is any sign:
  16. if distance between location of player and location of target block of player <= 5:
  17. if {teleportsign.%location of target block of player%.teleportTo} is not set:
  18. if (arg-2 parsed as a number) and (arg-3 parsed as a number) and (arg-4 parsed as a number) is set:
  19. set {_yaw} to 180
  20. set {_pitch} to 0
  21. set {_world} to world of player
  22. if arg-5 is set:
  23. if arg-5 parsed as a number is set:
  24. set {_yaw} to arg-5 parsed as a number
  25. if arg-6 and arg-6 parsed as a number is set:
  26. set {_pitch} to arg-6 parsed as a number
  27. if arg-7 is set:
  28. if arg-7 parsed as a world is set:
  29. set {_world} to arg-7 parsed as a world
  30. else:
  31. send "{@logo} The world %arg-7% &7does not exist."
  32. stop
  33. else:
  34. send "{@logo} Invalid Usage!%nl% &8- &7/tpsign delete%nl% &8- &7/tpsign create <x> <y> <z> [yaw] [pitch] [world]"
  35. stop
  36. else:
  37. send "{@logo} Invalid Usage!%nl% &8- &7/tpsign delete%nl% &8- &7/tpsign create <x> <y> <z> [yaw] [pitch] [world]"
  38. stop
  39.  
  40. # Set to variables = inefficient but I have done this to make sure the reloading does not take very long.
  41. set {_x} to x-coordinate of player
  42. set {_y} to y-coordinate of player
  43. set {_z} to z-coordinate of player
  44. set {_location} to location at {_x}, {_y}, {_z} in world {_world}
  45.  
  46. set {teleportsign.%location of target block of player%.teleportTo} to {_location}
  47. send "{@logo} You have created the telport sign."
  48. else:
  49. send "{@logo} Invalid Usage!%nl% &8- &7/tpsign delete%nl% &8- &7/tpsign create <x> <y> <z> [yaw] [pitch] [world]"
  50. #set {teleportsign.%location of target block of player%.teleportTo} to true
  51. else:
  52. send "{@logo} A teleport sign already exists at this location."
  53. else:
  54. send "{@logo} You must be looking at a sign."
  55. else:
  56. send "{@logo} You must be looking at a sign."
  57. else if arg-1 is "delete":
  58. if target block of player is any sign:
  59. if distance between location of player and location of target block of player <= 5:
  60. if {teleportsign.%location of target block of player%.teleportTo} is set:
  61. delete {teleportsign.%location of target block of player%.teleportTo}
  62. loop 4 times:
  63. set line loop-value of target block of player to ""
  64. send "{@logo} You have deleted the teleport sign at the location you were looking at."
  65. else:
  66. send "{@logo} There is no teleport sign found at the location you are looking at."
  67. else:
  68. send "{@logo} You must be looking at a sign."
  69. else:
  70. send "{@logo} You must be looking at a sign."
  71. else:
  72. send "{@logo} Invalid Usage!%nl% &8- &7/tpsign delete%nl% &8- &7/tpsign create <x> <y> <z> [yaw] [pitch] [world]"
  73.  
  74.  
  75. on break of any sign:
  76. if {teleportsign.%location of target block of player%.teleportTo} is set:
  77. cancel event
  78. send "{@logo} You cannot break a teleport sign."
  79.  
Advertisement
Add Comment
Please, Sign In to add comment