Zeldaboy111

Mobility Wand ]|[ Skript #312

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