Zeldaboy111

Skript #251 - map

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