Advertisement
Zeldaboy111

Skript #252 - Map

Oct 20th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.46 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 50 around location of loop-value:
  120. #Shoot arrow to entity
  121.  
  122.  
  123. command /wave [<text>]:
  124. trigger:
  125. if player has permission "TD.startWave":
  126.  
  127. clear inventory of player
  128. set {sword} to a wooden sword named "&fSword - Tier I"
  129. set {builder} to brick block named "&fTorens"
  130.  
  131. #Functies voor items
  132.  
  133. set slot 0 of player to {sword}
  134. set slot 4 of player to {builder}
  135.  
  136.  
  137.  
  138. if {health} is not set:
  139. set {health} to 10
  140.  
  141.  
  142. if {health} is 0:
  143. set {health} to 10
  144.  
  145. set {loc2} to location at -1, 96, -8
  146.  
  147. set {_loc} to location at -1, 97, 6
  148.  
  149. spawn zombie pigman at {_loc}
  150. set name of last spawned zombie pigman to "&2Zombie :: %arg 1%"
  151.  
  152. wait 1 second
  153. spawn zombie pigman at {_loc}
  154. set name of last spawned zombie pigman to "&2Zombie :: %arg 1%"
  155.  
  156. wait 1 second
  157. spawn zombie pigman at {_loc}
  158. set name of last spawned zombie pigman to "&2Zombie :: %arg 1%"
  159.  
  160. #clear all items in players inventory
  161.  
  162.  
  163.  
  164. command /editmap [<offline player>]:
  165. trigger:
  166. if arg 1 is not set:
  167. if player has permission "TD.editmap":
  168.  
  169. if {TD::edittingmap::%player%} is not set:
  170. set {TD::edittingmap::%player%} to true
  171. send "{@mprefix} Je kan de map nu bewerken."
  172.  
  173. else:
  174. clear {TD::edittingmap::%player%}
  175. send "{@mprefix} Je kan de map niet meer bewerken."
  176.  
  177. else:
  178. send "{@mprefix} &4Je hebt hier &convoldoende permissies &4voor!"
  179.  
  180. else:
  181.  
  182. if player has permission "TD.editmap.others":
  183. if {TD::edittingmap::%arg-1%} is not set:
  184. set {TD::edittingmap::%arg-1%} to true
  185.  
  186. if arg-1 is player:
  187. send "{@mprefix} Je kan de map nu bewerken."
  188.  
  189. else:
  190. send "{@mprefix} Je kan de map nu bewerken." to arg 1
  191. send "{@mprefix} De speler &l%arg 1% &fkan de map nu bewerken."
  192.  
  193. else:
  194. clear {TD::edittingmap::%arg-1%}
  195.  
  196. if arg-1 is player:
  197. send "{@mprefix} Je kan de map niet meer bewerken."
  198.  
  199. else:
  200. send "{@mprefix} Je kan de map niet meer bewerken." to arg 1
  201. send "{@mprefix} De speler &l%arg 1% &fkan de map niet meer bewerken."
  202.  
  203. else:
  204. send "{@mprefix} &4Je hebt hier &convoldoende permissies &4voor!"
  205.  
  206.  
  207. command /reset:
  208. trigger:
  209. if player has permission "TD.resetmap":
  210.  
  211. if {TD::reset::%player%} is true:
  212. send "{@mprefix} &4Je bent de map al aan het resetten."
  213.  
  214. else:
  215. set {TD::reset::%player%} to true
  216. send "{@mprefix} De map aan het resetten..."
  217.  
  218. loop {Count} times:
  219. set {Count} to loop-value
  220. set block at location of {TD::blockLoc::%{Count}%} to {TD::blockType::%{Count}%}
  221.  
  222. wait 10 ticks
  223. delete {TD::reset::%player%}
  224. send "{@mprefix} Map gereset!"
  225. else:
  226. send "{@mprefix} &4Je hebt hier &convoldoende permissies &4voor!"
  227.  
  228. # 1 -> create/remove, 2 -> mapnaam, 3 -> warp (bij create), 4 -> spelers (bij create)
  229. # 1 -> setwarp, 2 -> naam
  230. # 1 -> warplist
  231. command /sign [<text>] [<text>] [<text>] [<text>]:
  232. trigger:
  233. if player has permission "TD.joinsign":
  234. if arg 1 is "setwarp":
  235. if arg 2 is set:
  236. if {TD::warpList::*} doesn't contain "%arg 2%":
  237. send "{@mprefix} Warp %arg 2% gemaakt!"
  238.  
  239. add arg 2 to {TD::warpList::*}
  240. set {TD::warps::%arg 2%} to location of player
  241. set {_name} to arg 2
  242.  
  243. else:
  244. send "{@mprefix} &4De warp &c%arg 2% &4is al in gebruik."
  245.  
  246. else:
  247. send "{@mprefix} &4Je moet nog een &cwarpnaam &4opgeven."
  248.  
  249. else if arg 1 is "warplist":
  250. if {TD::warpList::*} is not empty:
  251. send "{@mprefix} Dit is de lijst met alle warps:%nl%%{TD::warpList::*}%"
  252. else:
  253. send "{@mprefix} Er zijn geen warps."
  254.  
  255. else if arg 1 is "create":
  256. if targeted block is not a sign:
  257. send "{@mprefix} &4Een join sign kan alleen een sign zijn."
  258.  
  259. else if {TD::%location of targeted block%} is set:
  260. send "{@mprefix} &4Het getargete blok is al een join sign."
  261.  
  262. else if arg 2 is set:
  263. if {TD::signList::*} contains arg 2:
  264. send "{@mprefix} &4De naam &c%arg 2% &4is al in gebruik."
  265.  
  266. else:
  267. if arg 3 is set:
  268. send "%{TD::warpList::*}%"
  269. if {TD::warpList::*} doesn't contain arg 3:
  270. send "{@mprefix} &4De warp &c%arg 3% &4bestaat niet."
  271.  
  272.  
  273.  
  274. else:
  275. if arg 4 is set:
  276. send "{@mprefix} Join sign gemaakt met de volgende eigenschappen:%nl%&fNaam: %arg 2%%nl%&fWarp: %arg 3%%nl%&fSpelers: %arg 4%"
  277. add arg 2 to {TD::signList::*}
  278. set {TD::wSign::%location of targeted block%} to arg 2
  279. set {TD::wSign::%arg 2%::warp} to arg 3
  280. set {TD::wSign::%arg 2%::maxP} to arg 4
  281.  
  282.  
  283. else:
  284. send "{@mprefix} &4Je moet nog een &caantal spelers &4opgeven."
  285.  
  286.  
  287.  
  288. else:
  289. send "{@mprefix} &4Je moet nog een &cwarp &4en &caantal spelers &4opgeven."
  290. else:
  291. send "{@mprefix} &4Je moet nog een &cnaam, warp &4en &caantal spelers &4opgeven."
  292.  
  293.  
  294. else if arg 1 is "remove":
  295. if targeted block is not a sign:
  296. send "{@mprefix} &4Een join sign kan alleen een sign zijn."
  297.  
  298. else:
  299. send "{@mprefix} Join sign aan het verwijderen..."
  300.  
  301. set {_name} to {TD::wSign::%location of targeted block%}
  302.  
  303. remove {_name} from {TD::signList::*}
  304. delete {TD::wSign::%location of targeted block%}
  305. delete {TD::wSign::%{_name}%::warp}
  306. delete {TD::wSign::%{_name}%::maxP}
  307.  
  308. wait 3 ticks
  309.  
  310. send "{@mprefix} Join sign verwijderd!"
  311.  
  312. else if arg 1 is set:
  313. send "{@mprefix} &4Het argument &c%arg 1% &4is ongeldig, kies uit de volgende argumenten: &ccreate, remove &4of &csetwarp&4."
  314.  
  315. else:
  316. send "{@mprefix} &4Je moet nog opgeven wat je wil doen, &ccreate, remove &4of &csetwarp&4."
  317.  
  318.  
  319. on click:
  320. if player is holding brick block named "&fTorens":
  321. cancel event
  322. open chest with 1 rows named "&fTorens" to player
  323. set {_loc} to location of targeted block
  324. #send "%z-coordinate of location of targeted block%" to player
  325. 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%")
  326. #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)
  327. #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)
  328.  
  329.  
  330. #function createTower(p: Player, tower: String, w: World, x: Number, y: Number, z: Number):
  331. function createTower(p: Player, tower: String, x: String, y: String, z: String):
  332.  
  333. if {_tower} is "archer":
  334. set {_w} to world of {_p}
  335.  
  336.  
  337. if {_y} starts with "-":
  338. replace "-" in {_y} with ""
  339. set {_y} to {_y} parsed as a number
  340. set {_y1} to "-%{_y}+1%"
  341. set {_y2} to "-%{_y}+2%"
  342. set {_y3} to "-%{_y}+3%"
  343. set {_y4} to "-%{_y}+4%"
  344.  
  345.  
  346. else:
  347. set {_y} to {_y} parsed as a number
  348. set {_y1} to {_y}+1
  349. set {_y2} to {_y}+2
  350. set {_y3} to {_y}+3
  351. set {_y4} to {_y}+4
  352.  
  353.  
  354. set {_x} to {_x} parsed as a number
  355. set {_z} to {_z} parsed as a number
  356.  
  357.  
  358. set {_loc1} to location {_x}, {_y1}, {_z} of world {_w}
  359. set {_loc2} to location {_x}, {_y2}, {_z} of world {_w}
  360. set {_loc3} to location {_x}, {_y3}, {_z} of world {_w}
  361. set {_loc4} to location {_x}, {_y4}, {_z} of world {_w}
  362.  
  363.  
  364.  
  365. set block at location of {_loc1} to oak_log
  366. set block at location of {_loc2} to oak_log
  367. set block at location of {_loc3} to cobblestone_wall
  368. set block at location of {_loc4} to anvil
  369.  
  370. add {_loc4} to {towers::archer::*}
  371. #set {_x} to x-coordinate of {_loc}
  372. #set {_y} to y-coordinate of {_loc}
  373. #set {_z} to z-coordinate of {_loc}
  374. #set {_world} to world of {_loc}
  375.  
  376. #set {_y1} to {_y}+1
  377.  
  378.  
  379.  
  380.  
  381. #set {_loc1} to location {_x}, {_y}, {_z} of world {_world}
  382.  
  383. #send "%{_loc}%" to {_p}
  384. #send "%{_x}%" to {_p}
  385. #send "%{_y}%" to {_p}
  386. #send "%{_z}%" to {_p}
  387. #send "%{_world}%" to {_p}
  388.  
  389. #set block at location of {_loc1} to dirt
  390.  
  391.  
  392.  
  393.  
  394. #send to {_p}
  395. #send "%{_tower}%" to {_p}
  396. #send "%{_loc}%" to {_p}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement