Advertisement
Blue_Tec

Untitled

Apr 22nd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.14 KB | None | 0 0
  1. options:
  2. Max Gate Size: 1000 # The amount of blocks that can be used per gate
  3. Gate Time: 0.7 seconds # The time of each animation stage
  4. Tool: bedrock # The tool used to create gates
  5. Default Block: fence # The default block used
  6. Enable Json: false # Set to true to enable json messages in /gatehelp. Requires json.sk found here: https://forums.skunity.com/t/json-sk-v1-1-skript-2-2-working-json-messages-for-1-8-3/70
  7. script load:
  8. loop {gates::*}:
  9. delete {gatetoggled::%loop-index%}
  10. command /gate [<text>]:
  11. permission: gate.add
  12. trigger:
  13. if arg is not set:
  14. if {temp::%player%::gate} is not set:
  15. send "&cYou don't have a gate selected. Use /gate <name>"
  16. stop
  17. send "&6You have unselected &c%{temp::%player%::gate}%&6."
  18. delete {temp::%player%::gate}
  19. stop
  20. set {temp::%player%::gate} to "%arg%"
  21. send "&6You have entered the gate editor for &a%{temp::%player%::gate}%&6 use &c/gate&6 to exit."
  22. right click:
  23. {temp::%player%::gate} is set
  24. player's gamemode is creative
  25. player's tool is not {@Tool}
  26. {gate::%{temp::%player%::gate}%::%y coord of block% %location of targeted block%} is set
  27. set {gatepaint::%{temp::%player%::gate}%::%y coord of targeted block% %location of targeted block%::open} to tool of player
  28. {gatetoggle::%{temp::%player%::gate}%} is not set:
  29. set targeted block to tool of player
  30. cancel event
  31. send "&6You have &aPainted &3%location of targeted block%&6 as &3%tool of player% &6for &3%{temp::%player%::gate}% OPEN&6."
  32. left click:
  33. {temp::%player%::gate} is set
  34. player's gamemode is creative
  35. player's tool is not {@Tool}
  36. {gate::%{temp::%player%::gate}%::%y coord of block% %location of targeted block%} is set
  37. set {gatepaint::%{temp::%player%::gate}%::%y coord of targeted block% %location of targeted block%::close} to tool of player
  38. {gatetoggle::%{temp::%player%::gate}%} is set:
  39. set targeted block to tool of player
  40. cancel event
  41. send "&6You have &aPainted &3%location of targeted block%&6 as &3%tool of player% &6for &3%{temp::%player%::gate}% CLOSE&6."
  42. place of {@Tool}:
  43. {temp::%player%::gate} is set
  44. player's gamemode is creative
  45. size of {gate.%{gate.%player%}%::*} is greater than or equal to {@Max Gate Size}:
  46. message "&4This gate has exceeded the place limit."
  47. stop
  48. if {gates::%{temp::%player%::gate}%} is not set:
  49. set {gates::%{temp::%player%::gate}%} to "%{temp::%player%::gate}%"
  50. if {gateblock::%{temp::%player%::gate}%} is not set:
  51. set {gateblock::%{temp::%player%::gate}%} to fence
  52. set {gate::%{temp::%player%::gate}%::%y coord of block% %location of block%} to location of block
  53. set block to {gateblock::%{temp::%player%::gate}%}
  54. send "&6You have &aadded &3%location of block%&6 to &3%{temp::%player%::gate}%&6."
  55. loop {gate::%{temp::%player%::gate}%::*}:
  56. block at loop-value is not {gateblock::%{temp::%player%::gate}%}
  57. set block at loop-value to {gateblock::%{temp::%player%::gate}%}
  58. delete {gatetoggle::%{temp::%player%::gate}%}
  59. break:
  60. {temp::%player%::gate} is set
  61. player's gamemode is creative
  62. {gate::%{temp::%player%::gate}%::%y coord of block% %location of block%} is set
  63. player's tool is {@Tool}
  64. delete {gatepaint::%{temp::%player%::gate}%::%y coord of block% %location of block%::*}
  65. delete {gate::%{temp::%player%::gate}%::%y coord of block% %location of block%}
  66. send "&6You have &cremoved &3%location of block%&6 from &3%{temp::%player%::gate}%&6."
  67. command /gatehelp:
  68. aliases: helpgate, helpgates, gateshelp
  69. trigger:
  70. if {@Enable Json} is true:
  71. send "&e-[ &bGates Interactive Help &e]-"
  72. make console execute command "json %player% &f1, Edit and Create Gates||ttp:&b&l[1] Edit and Create gates%nl%&6/gate <gate> &7- Create or Edit a Gate%nl%&6/gate &7- Exit Gate Selection%nl%%nl%&cClick to Deselect Selected Gate||cmd:/gate"
  73. make console execute command "json %player% &f2, Delete Gates||ttp:&b&l[2] Delete Gates%nl%&6/delgate <gate> &7- Delete a Gate%nl%%nl%&cClick to Delete Selected Gate||cmd:/delgate %{temp::%player%::gate}%"
  74. make console execute command "json %player% &f3, Toggle Gates||ttp:&b&l[3] Toggle Gates%nl%&6/togglegate <gate> &7- Toggle Gate Animation%nl%%nl%&cClick to Toggle Selected Gate||cmd:/togglegate %{temp::%player%::gate}%"
  75. make console execute command "json %player% &f4, List Gates & Auto Gates||ttp:&b&l[4] List Gates & Auto Gates%nl%&6/gates &7- Lists all Gates%nl%&6/autogates &7- Lists all Auto Gates%nl%&6/gateviewall &7- Lists all Gates & Auto Gates%nl%%nl%&cClick to View all Gates & Auto Gates||cmd:/gateviewall"
  76. make console execute command "json %player% &f5, Create and Remove Clickable Gates||ttp:&b&l[5] Create and Remove Clickable Gates%nl%&6/clickgate right <gate> &7- Make Target Block Trigger Gate%nl%&6/clickgate left <gate> &7- Make Target Block Trigger Gate%nl%&6/clickgate both <gate> &7- Make Target Block Trigger Gate%nl%&6right, left, both = &7 Right Click, Left Click, Click%nl%%nl%&cClick to Remove all Click Points from Selected Gate||cmd:/clickremover %{temp::%player%::gate}%"
  77. make console execute command "json %player% &f6, Change Gate Blocks||ttp:&b&l[6] Change Gate Blocks%nl%&6/gatetype <gate> <block> &7- Set Block for Gate%nl%&6-Painting-%nl%&7Right Click in gate edit mode on a gate block%nl%&7to paint it as the block in your hand. Left%nl%&7click to do the same for the close animation%nl%%nl%&cClick to Change all Selected Gate Blocks to Your Hand||cmd:/gatetype %{temp::%player%::gate}% %tool of player%"
  78. make console execute command "json %player% &f7, Manage Automated Gates||ttp:&b&l[7] Manage Automated Gates%nl%&6/autogate <gate> <radius> &7- Set a Radius Around%nl%&7Your Position to Automate Gate%nl%&6/delautogate &7- Deletes all Auto Gates%nl%&6/delautogate <gate> &7- Deletes Auto Gates for Gate%nl%%nl%&cClick to Delete ALL Auto Gates||cmd:/delautogate"
  79. else:
  80. send "&e-[ &bGates Help &e]-"
  81. send "&4WIP - Currently copy and pasted from spigot page!"
  82. send "&7Turn on 'Enable Json' for more information"
  83. send "&6/gate <gate name> &7= set points for a gate by placing a block"
  84. send "&6/gate &7= Clear gates mode so you no longer have to set points"
  85. send "&6/togglegate <gate name> &7= Toggle a gate"
  86. send "&6/gates &7= List all gates"
  87. send "&6/clickgate <right/left/both> <gate name> &7= Set a clickable left, right or both clicked block that will toggle the gate (look at the block then issue the command)"
  88. send "&6/gatetype <gate name> <block> &7= sets the block for a gate to animate. Resets all paint"
  89. send "&6/clickremover (gate) &7= removes all toggle blocks or a specific gates toggle blocks"
  90. send "&6/autogate <gate name> <radius> &7= Allows you to check the area around you and if someone is in the area the gate will open and if nobody is in the area the gate will close"
  91. send "&6/delautogate [<gate name>] &7= Deletes all auto gates or all auto gates connected to a specific gate"
  92. send "&6/autogates &7= Lists all auto gates currently active"
  93. send "&6/gateviewall &7= Shows all automated gates & gates"
  94. send "&6/gatehelp &7= Shows the help page"
  95. command /gateviewall:
  96. aliases: viewallgates, viewallgate, allgateview, viewgateall
  97. trigger:
  98. make player execute command "/gates"
  99. make player execute command "/autogates"
  100. command /togglegate <text>:
  101. permission: gate.toggle.command
  102. aliases: gatetoggle
  103. usage: /togglegate <gate name>
  104. trigger:
  105. if {gates::%arg 1%} is not set:
  106. send "&4This gate does not exist."
  107. stop
  108. if {gatetoggled::%arg%} is set:
  109. stop
  110. set {gatetoggled::%arg%} to true
  111. set {_loop} to 1
  112. loop {gate::%arg%::*}:
  113. if {gatetoggle::%arg%} is set:
  114. set {_gate} to {@Max Gate Size} - {_loop}
  115. set {_gate::%{_gate}%} to loop-value
  116. add 1 to {_loop}
  117. else:
  118. if {_y} is not y coord of loop-value:
  119. wait {@Gate Time}
  120. set {_y} to y coord of loop-value
  121. if {gatepaint::%arg%::%loop-index%::close} is set:
  122. set block at loop-value to {gatepaint::%arg%::%loop-index%::close}
  123. else:
  124. set block at loop-value to air
  125. if {gatetoggle::%arg%} is set:
  126. loop {_gate::*}:
  127. if {_y} is not y coord of loop-value:
  128. wait {@Gate Time}
  129. set {_y} to y coord of loop-value
  130. if {gatepaint::%arg%::%y coord of loop-value% %loop-value%::open} is set:
  131. set block at loop-value to {gatepaint::%arg%::%y coord of loop-value% %loop-value%::open}
  132. else:
  133. set block at loop-value to {gateblock::%arg%}
  134. delete {gatetoggle::%arg%}
  135. else:
  136. set {gatetoggle::%arg 1%} to true
  137. delete {gatetoggled::%arg 1%}
  138. command /deletegate <text>:
  139. permission: gate.remove
  140. aliases: removegate, delgate, gateremove, gatedel, gatedelete
  141. usage: /gate <gate name>
  142. trigger:
  143. {gates::%arg%} is not set:
  144. send "&4This gate does not exist."
  145. stop
  146. delete {gate::%arg%::*}
  147. delete {gateblock::%arg%}
  148. send "&6You have deleted %arg%."
  149. delete {gates::%arg%}
  150. delete {gatetoggle::%arg%}
  151. delete {gateauto::%arg%::*}
  152. delete {gatepaint::%arg%::*}
  153. loop {gateclicklocations::*}:
  154. loop-index is arg
  155. delete {gateclicklocations::%loop-index%}
  156. delete {gateclick.%loop-value%::*}
  157. if {temp::%player%::gate} is "%arg%":
  158. delete {temp::%player%::gate}
  159. command /gatetype <text> <item>:
  160. permission: gate.type
  161. usage: /gatetype <gate name> <block>
  162. aliases: typegate
  163. trigger:
  164. {gates::%arg 1%} is not set:
  165. send "&4This gate does not exist."
  166. stop
  167. set {gateblock::%arg 1%} to arg 2
  168. send "&6You have set &a%arg 1%&6 to &a%arg 2%&6."
  169. loop {gate::%arg 1%::*}:
  170. set block at loop-value to arg 2
  171. delete {gatetoggle::%arg 1%}
  172. delete {gatepaint::%arg 1%::*}
  173. command /gates:
  174. permission: gate.list
  175. aliases: gatelist, listgates, listgate
  176. trigger:
  177. if {gates::*} is not set:
  178. send "&cNo gates to display."
  179. stop
  180. send "&e-[ &bActive Gates &e]-"
  181. send " %{gates::*}%"
  182. command /clickgate <text> <text>:
  183. permission: gate.toggle.click.set
  184. aliases: gateclick
  185. usage: /clickgate <right/left/both> <gate name>
  186. trigger:
  187. if {gates::%arg 2%} is not set:
  188. send "&4The gate %arg 2% does not exist."
  189. stop
  190. arg 1 is "right", "left" or "both"
  191. set {gateclick.%location of targeted block%::%arg 2%} to arg 1
  192. set {gateclicklocations::%arg 2%} to location of targeted block
  193. send "&6You have set &a%location of targeted block%&6 for &a%arg 1% clicks&6 pointing towards &a%arg 2%&6."
  194. command /clickremover [<text>]:
  195. permission: gate.click.removal
  196. trigger:
  197. if arg is not set:
  198. if {gateclicklocations::*} is not set:
  199. send "&cNo click locations are set."
  200. stop
  201. loop {gateclicklocations::*}:
  202. delete {gateclicklocations::%loop-index%}
  203. delete {gateclick.%loop-value%::*}
  204. send "&6You have &cremoved&6 all gate toggles."
  205. stop
  206. {gates::%arg%} is not set:
  207. send "&4This gate does not exist."
  208. stop
  209. loop {gateclicklocations::*}:
  210. loop-index is arg
  211. delete {gateclicklocations::%loop-index%}
  212. delete {gateclick.%loop-value%::*}
  213. set {_} to true
  214. if {_} is not set:
  215. send "&cThere are no gate toggles pointing towards %arg%."
  216. stop
  217. send "&6You have removed anything that would point to &c%arg%&6."
  218. command /gateauto <text> <number>:
  219. permission: gate.automation
  220. aliases: gateautomation, autogate
  221. usage: /gateauto <gate name> <radius>
  222. trigger:
  223. if {gates::%arg 1%} is not set:
  224. send "&4The gate %arg 1% does not exist."
  225. stop
  226. set {gateauto::%arg 1%::%arg 2%} to location of player
  227. send "&6You have set &a%location of player%&6 to automate &a%arg 1%&6 at a radius of &a%arg 2%&6."
  228. command /gatesauto:
  229. aliases: autogates
  230. permission: gate.automation.list
  231. trigger:
  232. loop {gates::*}:
  233. loop {gateauto::%loop-index-1%::*}:
  234. add "%loop-index-1%: Radius %loop-index-2% Location %loop-value-2%" to {_list::*}
  235. if {_list::*} is not set:
  236. send "&cThere are no automated gates."
  237. stop
  238. send "&e-[ &bAutomated Gates&e ]-"
  239. send " %{_list::*}%"
  240. command /delgateauto [<text>]:
  241. aliases: delautogate
  242. permission: gate.automation.deletion
  243. trigger:
  244. if arg is not set:
  245. loop {gates::*}:
  246. {gateauto::%loop-index%::*} is set
  247. delete {gateauto::%loop-index%::*}
  248. set {_} to true
  249. if {_} is set:
  250. send "&6You have &cdeleted all&6 autogates."
  251. else:
  252. send "&cThere are no auto gates"
  253. else:
  254. if {gateauto::%arg%::*} is not set:
  255. send "&c%arg% has no auto gates."
  256. stop
  257. delete {gateauto::%arg%::*}
  258. send "&6You have &cdeleted %arg%&6's autogates."
  259. any movement:
  260. loop {gates::*}:
  261. loop {gateauto::%loop-index-1%::*}:
  262. set {_loc} to loop-value-2
  263. set {_number} to "%loop-index-2%" parsed as number
  264. if distance between player and {_loc} is less than {_number}:
  265. {gatetoggle::%loop-index-1%} is not set
  266. make console execute command "togglegate %loop-index-1%"
  267. else:
  268. loop players in radius {_number} * 1.5 around player:
  269. loop-player is set
  270. loop-player is not player
  271. stop
  272. {gatetoggle::%loop-index-1%} is set
  273. make console execute command "togglegate %loop-index-1%"
  274. click:
  275. {gateclick.%location of clicked block%::*} is set
  276. player has permission "gate.toggle.click.both"
  277. loop {gateclick.%location of clicked block%::*}:
  278. loop-value is "both"
  279. if {gatetoggled::%loop-index%} is set:
  280. add 1 to {_gatesconnected}
  281. {_gatesconnected} is greater than or equal to size of {gateclick.%location of clicked block%::*}
  282. cancel event
  283. else:
  284. make console execute command "togglegate %loop-index%"
  285. left click:
  286. {gateclick.%location of clicked block%::*} is set
  287. player has permission "gate.toggle.click.left"
  288. loop {gateclick.%location of clicked block%::*}:
  289. loop-value is "left"
  290. if {gatetoggled::%loop-index%} is set:
  291. add 1 to {_gatesconnected}
  292. {_gatesconnected} is greater than or equal to size of {gateclick.%location of clicked block%::*}
  293. cancel event
  294. else:
  295. make console execute command "togglegate %loop-index%"
  296. right click:
  297. {gateclick.%location of clicked block%::*} is set
  298. player has permission "gate.toggle.click.right"
  299. loop {gateclick.%location of clicked block%::*}:
  300. loop-value is "right"
  301. if {gatetoggled::%loop-index%} is set:
  302. add 1 to {_gatesconnected}
  303. {_gatesconnected} is greater than or equal to size of {gateclick.%location of clicked block%::*}
  304. cancel event
  305. else:
  306. make console execute command "togglegate %loop-index%"
  307. quit:
  308. delete {temp::%player%::gate}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement