Zeldaboy111

Mobility Wand ]|[ Skript #312

May 17th, 2020
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.01 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.  
  9. options:
  10. logo: &a&lWands &8:&7
  11.  
  12. on enable:
  13. set {wands.distanceLock.IceWand::*} to 30 and 12
  14. set {wands.distanceLock.MobilityWand::*} to 36 and 0
  15. set {wands.cooldown.IceWand::*} to 0.7 and 2.4
  16. set {wands.cooldown.MobilityWand::*} to 3.8 and 9.3
  17.  
  18. function spawnFallingBlock_Ice(loc: Location, p: Player):
  19. spawn falling ice at {_loc}
  20. set {_block} to last spawned falling ice
  21. show 7 snow shovel at {_loc}
  22.  
  23. loop entities in radius 2.6 around {_loc}:
  24. set {_damage} to 5
  25. if loop-entity is not {_p}:
  26. set {_dist} to (distance between location of loop-entity and {_loc})
  27. remove {_dist} from {_damage}
  28. damage loop-entity by {_damage} hearts
  29.  
  30. wait 3 ticks
  31.  
  32. play sound "block.glass.break" with volume 4 at {_loc}
  33. if {_block} is alive:
  34. kill {_block}
  35. else:
  36. if block at {_loc} is ice:
  37. set block at {_loc} to air
  38.  
  39. function checkSpell(p: Player, wand: String, spellAmount: Number, spell: String):
  40. set {_spells::*} to {_spell} split at ", "
  41.  
  42. if {wands.%{_p}%.spellSelected::%{_wand}%} is not set:
  43. set {wands.%{_p}%.spellSelected::%{_wand}%} to 1
  44. send "{@logo} Spell &2&l%{_spells::1}% &7Selected!" to {_p}
  45.  
  46. if {wands.%{_p}%.spellSelected::%{_wand}%} < {_spellAmount}:
  47. send "{@logo} Spell &2&l%{_spells::%{wands.%{_p}%.spellSelected::%{_wand}%}%}% &7Selected!" to {_p}
  48. add 1 to {wands.%{_p}%.spellSelected::%{_wand}%}
  49. else:
  50. send "{@logo} Spell &2&l%{_spells::%{wands.%{_p}%.spellSelected::%{_wand}%}%}% &7Selected!" to {_p}
  51. set {wands.%{_p}%.spellSelected::%{_wand}%} to 1
  52.  
  53. function getSpell(p: Player, wand: String) :: number:
  54. if {wands.%{_p}%.lastSpellUsed} is set:
  55. if difference between now and {wands.%{_p}%.lastSpellUsed} < {wands.%{_p}%.lastSpellCooldown}:
  56. send "{@logo} You are too tired to use this spell." to {_p}
  57. stop
  58.  
  59. set {_spell} to 1
  60. if {wands.%{_p}%.spellSelected::%{_wand}%} is set:
  61. set {_spell} to {wands.%{_p}%.spellSelected::%{_wand}%}
  62.  
  63. set {wands.%{_p}%.lastSpellUsed} to now
  64. set {wands.%{_p}%.lastSpellCooldown} to "%{wands.cooldown.%{_wand}%::%{_spell}%}% seconds" parsed as a timespan
  65.  
  66. return {_spell}
  67.  
  68. function getTarget(p: Player, wand: String, spell: number) :: location:
  69. set {_target} to location of targeted block of {_p}
  70. if distance between location of targeted entity of {_p} and {_target} >= {wands.distanceLock.%{_wand}%::%{_spell}%}:
  71. set {_target} to location of block {wands.distanceLock.%{_wand}%::%{_spell}%} meters in front of {_p}
  72. else if block at {_target} is not set:
  73. set {_target} to location of block {wands.distanceLock.%{_wand}%::%{_spell}%} meters in front of {_p}
  74. else if distance between location of {_p} and {_target} >= {wands.distanceLock.%{_wand}%::%{_spell}%}:
  75. set {_target} to location of block {wands.distanceLock.%{_wand}%::%{_spell}%} meters in front of {_p}
  76.  
  77. return {_target}
  78.  
  79. command /wands [<text>] [<text>] [<text>] [<text>] [<text>] [<text>]:
  80. aliases: /wand
  81. trigger:
  82. if executor is not a player:
  83. send "{@logo} This command can only be executed by a player."
  84.  
  85. if player has permission "wand.*":
  86. if arg-1 is "help":
  87. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  88. send "<ttp:&7Get a guide about this Skript><sgt:/wand guide>&2/wand guide [page]"
  89. send "<ttp:&7Get a list of all wands><sgt:/wand list>&2/wand list"
  90. send "<ttp:&7Get a list of all spells><sgt:/wand spells><sgt:/wand spells>&2/wand spells [wand]"
  91. send "<ttp:&7Get a wand><sgt:/wand get >&2/wand get <wand>"
  92. send "%nl%&7Try clicking and hovering over them."
  93. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  94.  
  95. else if arg-1 is "guide":
  96. if arg-2 is "1":
  97. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  98. send "&7The Wands Skript is user friendly, herefore there are added some tweaks for you to use. In this guide there will be explained how it works."
  99. send "&7Wands can be used by any player when it is given to them. The command execution has a <ttp:&7wand.*>&2permission&r&7, so not every player can get a wand by using this command."
  100. send "%nl%&7Next Page <ttp:&7Next Page><cmd:/wands guide 2>&a>>"
  101. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  102.  
  103. else if arg-2 is "2":
  104. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  105. send "&a&lGetting a Wand&8:%nl% "
  106. send "&7Getting a wand can be done in two ways, either by executing the <ttp:&7Click to Autofill><sgt:/wand get <wand>>&2get-command &r&7or by clicking the <ttp:&7Click to Autofill><sgt:/wand list>&2Wands List&7."
  107. send "%nl%&a&lUsing a Wand&8:"
  108. send "%nl%&7Every player can use a wand. The controls are as follows&8:%nl%"
  109. send "&8♦ &aLeft-Click &8|| &7Left-Clicking will execute the spell."
  110. send "&8♦ &aRight-Click &8|| &7Right-Clicking will let you cycle through all spells."
  111. send "%nl%<ttp:&7Next Page><cmd:/wands guide 1>&a<<&r &7Previous Page"
  112. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  113.  
  114. else:
  115. execute player command "/wand guide 1"
  116.  
  117. else if arg-1 is "list":
  118. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  119. send "&7These are all current wands:%nl%"
  120. send "&8♦ <ttp:&7Click to Get><cmd:/wand get ice>&2&lIce Wand &8|| <ttp:&7Click to get the Spell List><cmd:/wand spells ice>&2Spell List%nl%&8♦ <ttp:&7Click to Get><cmd:/wand get mobility>&2&lMobility Wand &8|| <ttp:&7Click to get the Spell List><cmd:/wand spells mobility>&2Spell List"
  121. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  122.  
  123. else if arg-1 is "get":
  124. if arg-2 is "ice":
  125. give player iron axe named "&bIce Wand" with lore "&5&kl"
  126. else if arg-2 is "mobility":
  127. give player a feather named "&7Mobility Wand" with lore "&5&kl"
  128.  
  129. else if arg-1 is "spells":
  130. if arg-2 is "ice":
  131. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  132. send "&8♦ <ttp:&7Damages your opponent>&2&lIce Spark"
  133. send "&8♦ <ttp:&7Summon a snake to attack your opponent>&2&lIce Snake"
  134. #Freeze spell??
  135. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  136.  
  137. else if arg-2 is "mobility":
  138. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  139. send "&8♦ <ttp:&7Teleports you to a location>&2&lTeleport"
  140. send "&8♦ <ttp:&7Makes you fast and agile>&2&lAssassin"
  141. #Other player teleport
  142. send "%nl%&8&m &8[ &a&lWands &8]&m %nl% "
  143.  
  144. else:
  145. if arg-2 is set:
  146. send "{@logo} Invalid Wand! Do <sgt:&7Click to Execute><cmd:/wand list>&2/wand list &r&7for a full list with all wands."
  147. else:
  148. send "{@logo} Incorrect Usage! &2/wand spells <wand>&7."
  149. else:
  150. send "{@logo} Incorrect Usage! Do <ttp:&7Click to Execute><cmd:/wand help>&2/wand help&r &7for more info."
  151.  
  152.  
  153. on right click:
  154. if player is holding an iron axe named "&bIce Wand" with lore "&5&kl":
  155. checkSpell(player, "IceWand", 2, "Ice Snake, Ice Spark")
  156.  
  157. else if player is holding a feather named "&7Mobility Wand" with lore "&5&kl":
  158. checkSpell(player, "MobilityWand", 2, "Assassin, Teleport")
  159.  
  160.  
  161. on left click:
  162. if player is holding an iron axe named "&bIce Wand" with lore "&5&kl":
  163. cancel event
  164. set {_spell} to getSpell(player, "IceWand")
  165. set {_target} to getTarget(player, "IceWand", {_spell})
  166.  
  167. if {_spell} is 1:
  168. show 12 snow shovel at {_target}
  169. loop entities in radius 2.1 around {_target}:
  170. set {_damage} to 3
  171. if loop-entity is not player:
  172. set {_dist} to (distance between location of loop-entity and {_target})
  173. remove {_dist} from {_damage}
  174. damage loop-entity by {_damage} hearts
  175.  
  176. else if {_spell} is 2:
  177. loop blocks from block at location 0.8 meter above player to block at {_target}:
  178. spawnFallingBlock_Ice(location of loop-block, player)
  179. wait 1 ticks
  180.  
  181. else if player is holding a feather named "&7Mobility Wand" with lore "&5&kl":
  182. cancel event
  183. set {_spell} to getSpell(player, "MobilityWand")
  184. set {_target} to getTarget(player, "MobilityWand", {_spell})
  185.  
  186. if {_spell} is 1:
  187. show 120 nether portal at the player
  188. apply slowness 10 to player for 4 seconds
  189. wait 2 seconds
  190. teleport player to location 1 meters above {_target}
  191. play sound "entity.enderman.teleport" with volume 7 at location of player
  192. show 120 nether portal at the player
  193.  
  194. else if {_spell} is 2:
  195. apply slowness 10 to player for 0.7 seconds
  196. show 200 small smoke at the player
  197.  
  198. wait 0.7 seconds
  199. apply speed 1 to player for 6 seconds
  200. apply jump boost 1 to player for 6 seconds
  201. apply invisibility 1 to player for 6 seconds
  202. loop 6 times:
  203. wait 1 second
  204. show 96 small smoke at the player
  205.  
  206.  
  207. #PARTICLES
  208. #show mob spawner flames at the player
  209. #show 10 note at the player
Add Comment
Please, Sign In to add comment