Zeldaboy111

Skript #253 - Map

Oct 21st, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.81 KB | None | 0 0
  1. options:
  2.  
  3. prefix: &f[&aTD&f]
  4. mprefix: &f[&aTD&f] &6>>&f
  5. {TD::edittingmap::%arg-1%} = {TD::edittingmap::%player%}
  6. {TD::blockLoc::%{TD::cancelBreak::num::%location of event-block%}%} = {TD::blockLoc::%{Count}%}
  7. {TD::blockType::%{TD::cancelBreak::num::%location of event-block%}%} = {TD::blockType::%{Count}%}
  8. {TD::wSign::%arg 2%::warp} = {TD::wSign::%{_name}%::warp} = {TD::wSign::%location of clicked block%::warp}
  9. {TD::wSign::%location of targeted block%} = {TD::wSign::%location of clicked block%}
  10. {TD::warps::%arg 2%} = {TD::warps::%{_name}%}
  11.  
  12.  
  13.  
  14. on join:
  15. if world of player is "TD":
  16. clear inventory of player
  17. set gamemode of player to adventure
  18.  
  19.  
  20. on enderman place:
  21. if world of event-block is "TD":
  22. cancel event
  23.  
  24.  
  25. on enderman pickup:
  26. if world of event-block is "TD":
  27. cancel event
  28.  
  29.  
  30. on place:
  31. if world of event-block is "TD":
  32. if {TD::edittingmap::%player%} is not set:
  33. cancel event
  34. stop
  35.  
  36. else:
  37. set {TD::blockLoc::%{Count}%} to location of event-block
  38. set {TD::blockType::%{Count}%} to type of event-block
  39. set {TD::cancelBreak::%location of event-block%} to true
  40. set {TD::cancelBreak::num::%location of event-block%} to {Count}
  41. add 1 to {Count}
  42.  
  43.  
  44.  
  45. on break:
  46. if world of event-block is "TD":
  47. if {TD::edittingmap::%player%} is not set:
  48. if {TD::cancelBreak::%location of event-block%} is true:
  49. cancel event
  50. stop
  51.  
  52. else:
  53. if {TD::cancelBreak::%location of event-block%} is true:
  54. delete {TD::blockLoc::%{TD::cancelBreak::num::%location of event-block%}%}
  55. delete {TD::blockType::%{TD::cancelBreak::num::%location of event-block%}%}
  56. delete {TD::cancelBreak::%location of event-block%}
  57. delete {TD::cancelBreak::num::%location of event-block%}
  58. remove 1 from {Count}
  59.  
  60.  
  61.  
  62. on rightclick:
  63. if clicked block is a sign:
  64. if {TD::wSign::%location of clicked block%} is set:
  65. set {_name} to {TD::wSign::%location of clicked block%}
  66. set {_warp} to {TD::wSign::%{_name}%::warp}
  67.  
  68.  
  69.  
  70. teleport player to {TD::warps::%{_warp}%}
  71.  
  72. on death:
  73. if world of victim is "TD":
  74. if name of victim is "&2Zombie :: 1":
  75. clear drops
  76.  
  77. on drop:
  78. if world of player is "TD":
  79. if gamemode of player is not creative:
  80. cancel event
  81.  
  82. on inventory click:
  83. if world of player is "TD":
  84. if gamemode of player is not creative:
  85. cancel event
  86.  
  87.  
  88.  
  89. every 1 tick:
  90. loop all entities in world "TD":
  91. if name of loop-value is "&2Zombie :: 1":
  92. if distance between loop-value and {loc2} is smaller than 2:
  93. if loop-value is alive:
  94. kill loop-value
  95.  
  96. set {health} to {health}-1
  97.  
  98. if {health} is more than 0:
  99. send "{@prefix} &4Health: &f%{health}%" to all players in world "TD"
  100.  
  101. else:
  102. send "{@prefix} &4Je hebt verloren!" to all players in world "TD"
  103. delete {health}
  104.  
  105. loop all entities in world "TD":
  106. if name of loop-value-2 is "&2Zombie :: 1":
  107. kill loop-value-2
  108.  
  109.  
  110.  
  111. else:
  112. make loop-value pathfind to {loc2} with speed 1
  113.  
  114.  
  115. every 5 seconds:
  116. loop {towers::archer::*}:
  117. if {health} is set:
  118. if {health} is more than 0:
  119. loop all entities in radius 12 around location of loop-value:
  120. if name of loop-value-2 contains "&2Zombie :: ":
  121.  
  122. set {_dir} to direction from {_loc} to loop-value-2
  123.  
  124. set {_loc} to loop-value-1
  125. spawn arrow at location of {_loc}
  126. push last spawned arrow {_dir} at speed 1
  127.  
  128. command /wave [<text>]:
  129. trigger:
  130. if player has permission "TD.startWave":
  131.  
  132. clear inventory of player
  133. set {sword} to a wooden sword named "&fSword - Tier I"
  134. set {builder} to brick block named "&fTorens"
  135.  
  136. #Functies voor items
  137.  
  138. set slot 0 of player to {sword}
  139. set slot 4 of player to {builder}
  140.  
  141.  
  142.  
  143. if {health} is not set:
  144. set {health} to 10
  145.  
  146.  
  147. if {health} is 0:
  148. set {health} to 10
  149.  
  150. set {loc2} to location at -1, 96, -8
  151.  
  152. set {_loc} to location at -1, 97, 6
  153.  
  154. spawn zombie pigman at {_loc}
  155. set name of last spawned zombie pigman to "&2Zombie :: %arg 1%"
  156.  
  157. wait 1 second
  158. spawn zombie pigman at {_loc}
  159. set name of last spawned zombie pigman to "&2Zombie :: %arg 1%"
  160.  
  161. wait 1 second
  162. spawn zombie pigman at {_loc}
  163. set name of last spawned zombie pigman to "&2Zombie :: %arg 1%"
  164.  
  165. #clear all items in players inventory
  166.  
  167.  
  168.  
  169. command /editmap [<offline player>]:
  170. trigger:
  171. if arg 1 is not set:
  172. if player has permission "TD.editmap":
  173.  
  174. if {TD::edittingmap::%player%} is not set:
  175. set {TD::edittingmap::%player%} to true
  176. send "{@mprefix} Je kan de map nu bewerken."
  177.  
  178. else:
  179. clear {TD::edittingmap::%player%}
  180. send "{@mprefix} Je kan de map niet meer bewerken."
  181.  
  182. else:
  183. send "{@mprefix} &4Je hebt hier &convoldoende permissies &4voor!"
  184.  
  185. else:
  186.  
  187. if player has permission "TD.editmap.others":
  188. if {TD::edittingmap::%arg-1%} is not set:
  189. set {TD::edittingmap::%arg-1%} to true
  190.  
  191. if arg-1 is player:
  192. send "{@mprefix} Je kan de map nu bewerken."
  193.  
  194. else:
  195. send "{@mprefix} Je kan de map nu bewerken." to arg 1
  196. send "{@mprefix} De speler &l%arg 1% &fkan de map nu bewerken."
  197.  
  198. else:
  199. clear {TD::edittingmap::%arg-1%}
  200.  
  201. if arg-1 is player:
  202. send "{@mprefix} Je kan de map niet meer bewerken."
  203.  
  204. else:
  205. send "{@mprefix} Je kan de map niet meer bewerken." to arg 1
  206. send "{@mprefix} De speler &l%arg 1% &fkan de map niet meer bewerken."
  207.  
  208. else:
  209. send "{@mprefix} &4Je hebt hier &convoldoende permissies &4voor!"
  210.  
  211.  
  212. command /reset:
  213. trigger:
  214. if player has permission "TD.resetmap":
  215.  
  216. if {TD::reset::%player%} is true:
  217. send "{@mprefix} &4Je bent de map al aan het resetten."
  218.  
  219. else:
  220. set {TD::reset::%player%} to true
  221. send "{@mprefix} De map aan het resetten..."
  222.  
  223. loop {Count} times:
  224. set {Count} to loop-value
  225. set block at location of {TD::blockLoc::%{Count}%} to {TD::blockType::%{Count}%}
  226.  
  227. wait 10 ticks
  228. delete {TD::reset::%player%}
  229. send "{@mprefix} Map gereset!"
  230. else:
  231. send "{@mprefix} &4Je hebt hier &convoldoende permissies &4voor!"
  232.  
  233. # 1 -> create/remove, 2 -> mapnaam, 3 -> warp (bij create), 4 -> spelers (bij create)
  234. # 1 -> setwarp, 2 -> naam
  235. # 1 -> warplist
  236. command /sign [<text>] [<text>] [<text>] [<text>]:
  237. trigger:
  238. if player has permission "TD.joinsign":
  239. if arg 1 is "setwarp":
  240. if arg 2 is set:
  241. if {TD::warpList::*} doesn't contain "%arg 2%":
  242. send "{@mprefix} Warp %arg 2% gemaakt!"
  243.  
  244. add arg 2 to {TD::warpList::*}
  245. set {TD::warps::%arg 2%} to location of player
  246. set {_name} to arg 2
  247.  
  248. else:
  249. send "{@mprefix} &4De warp &c%arg 2% &4is al in gebruik."
  250.  
  251. else:
  252. send "{@mprefix} &4Je moet nog een &cwarpnaam &4opgeven."
  253.  
  254. else if arg 1 is "warplist":
  255. if {TD::warpList::*} is not empty:
  256. send "{@mprefix} Dit is de lijst met alle warps:%nl%%{TD::warpList::*}%"
  257. else:
  258. send "{@mprefix} Er zijn geen warps."
  259.  
  260. else if arg 1 is "create":
  261. if targeted block is not a sign:
  262. send "{@mprefix} &4Een join sign kan alleen een sign zijn."
  263.  
  264. else if {TD::%location of targeted block%} is set:
  265. send "{@mprefix} &4Het getargete blok is al een join sign."
  266.  
  267. else if arg 2 is set:
  268. if {TD::signList::*} contains arg 2:
  269. send "{@mprefix} &4De naam &c%arg 2% &4is al in gebruik."
  270.  
  271. else:
  272. if arg 3 is set:
  273. send "%{TD::warpList::*}%"
  274. if {TD::warpList::*} doesn't contain arg 3:
  275. send "{@mprefix} &4De warp &c%arg 3% &4bestaat niet."
  276.  
  277.  
  278.  
  279. else:
  280. if arg 4 is set:
  281. send "{@mprefix} Join sign gemaakt met de volgende eigenschappen:%nl%&fNaam: %arg 2%%nl%&fWarp: %arg 3%%nl%&fSpelers: %arg 4%"
  282. add arg 2 to {TD::signList::*}
  283. set {TD::wSign::%location of targeted block%} to arg 2
  284. set {TD::wSign::%arg 2%::warp} to arg 3
  285. set {TD::wSign::%arg 2%::maxP} to arg 4
  286.  
  287.  
  288. else:
  289. send "{@mprefix} &4Je moet nog een &caantal spelers &4opgeven."
  290.  
  291.  
  292.  
  293. else:
  294. send "{@mprefix} &4Je moet nog een &cwarp &4en &caantal spelers &4opgeven."
  295. else:
  296. send "{@mprefix} &4Je moet nog een &cnaam, warp &4en &caantal spelers &4opgeven."
  297.  
  298.  
  299. else if arg 1 is "remove":
  300. if targeted block is not a sign:
  301. send "{@mprefix} &4Een join sign kan alleen een sign zijn."
  302.  
  303. else:
  304. send "{@mprefix} Join sign aan het verwijderen..."
  305.  
  306. set {_name} to {TD::wSign::%location of targeted block%}
  307.  
  308. remove {_name} from {TD::signList::*}
  309. delete {TD::wSign::%location of targeted block%}
  310. delete {TD::wSign::%{_name}%::warp}
  311. delete {TD::wSign::%{_name}%::maxP}
  312.  
  313. wait 3 ticks
  314.  
  315. send "{@mprefix} Join sign verwijderd!"
  316.  
  317. else if arg 1 is set:
  318. send "{@mprefix} &4Het argument &c%arg 1% &4is ongeldig, kies uit de volgende argumenten: &ccreate, remove &4of &csetwarp&4."
  319.  
  320. else:
  321. send "{@mprefix} &4Je moet nog opgeven wat je wil doen, &ccreate, remove &4of &csetwarp&4."
  322.  
  323.  
  324. on click:
  325. if player is holding brick block named "&fTorens":
  326. cancel event
  327. open chest with 1 rows named "&fTorens" to player
  328. set {_loc} to location of targeted block
  329. #send "%z-coordinate of location of targeted block%" to player
  330. make gui slot 0 of player with a arrow named "&2Archer Tower" to close then run function createTower(player, "archer", "%x-coordinate of location of targeted block%", "%y-coordinate of location of targeted block%", "%z-coordinate of location of targeted block%")
  331. #make gui slot 0 of player with a arrow named "&2Archer Tower" to close then run function createTower(player, "archer", world of player, x-coordinate of location of clicked block, y-coordinate of location of clicked block, z-coordinate of location of clicked block)
  332. #make gui slot 0 of player with a arrow named "&2Archer Tower" to close then run function createTower(player, "archer", x-coordinate of location of clicked block, y-coordinate of location of clicked block, z-coordinate of location of clicked block, world of player)
  333.  
  334.  
  335. #function createTower(p: Player, tower: String, w: World, x: Number, y: Number, z: Number):
  336. function createTower(p: Player, tower: String, x: String, y: String, z: String):
  337.  
  338. if {_tower} is "archer":
  339. set {_w} to world of {_p}
  340.  
  341. #clear {towers::archer::*}
  342.  
  343. if {_y} starts with "-":
  344. replace "-" in {_y} with ""
  345. set {_y} to {_y} parsed as a number
  346. set {_y1} to "-%{_y}+1%"
  347. set {_y2} to "-%{_y}+2%"
  348. set {_y3} to "-%{_y}+3%"
  349. set {_y4} to "-%{_y}+4%"
  350. set {_y5} to "-%{_y}+6%"
  351.  
  352. else:
  353. set {_y} to {_y} parsed as a number
  354. set {_y1} to {_y}+1
  355. set {_y2} to {_y}+2
  356. set {_y3} to {_y}+3
  357. set {_y4} to {_y}+4
  358. set {_y5} to {_y}+6
  359.  
  360.  
  361. set {_x} to {_x} parsed as a number
  362. set {_z} to {_z} parsed as a number
  363.  
  364.  
  365. set {_loc1} to location {_x}, {_y1}, {_z} of world {_w}
  366. set {_loc2} to location {_x}, {_y2}, {_z} of world {_w}
  367. set {_loc3} to location {_x}, {_y3}, {_z} of world {_w}
  368. set {_loc4} to location {_x}, {_y4}, {_z} of world {_w}
  369. set {_loc5} to location {_x}, {_y5}, {_z} of world {_w}
  370.  
  371.  
  372.  
  373. set block at location of {_loc1} to oak_log
  374. set block at location of {_loc2} to oak_log
  375. set block at location of {_loc3} to cobblestone_wall
  376. set block at location of {_loc4} to anvil
  377.  
  378. add {_loc5} to {towers::archer::*}
  379. #set {_x} to x-coordinate of {_loc}
  380. #set {_y} to y-coordinate of {_loc}
  381. #set {_z} to z-coordinate of {_loc}
  382. #set {_world} to world of {_loc}
  383.  
  384. #set {_y1} to {_y}+1
  385.  
  386.  
  387.  
  388.  
  389. #set {_loc1} to location {_x}, {_y}, {_z} of world {_world}
  390.  
  391. #send "%{_loc}%" to {_p}
  392. #send "%{_x}%" to {_p}
  393. #send "%{_y}%" to {_p}
  394. #send "%{_z}%" to {_p}
  395. #send "%{_world}%" to {_p}
  396.  
  397. #set block at location of {_loc1} to dirt
  398.  
  399.  
  400.  
  401.  
  402. #send to {_p}
  403. #send "%{_tower}%" to {_p}
  404. #send "%{_loc}%" to {_p}
Add Comment
Please, Sign In to add comment