Advertisement
Zeldaboy111

Skript #245 - map

Sep 29th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.45 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. #options:
  13.  
  14. on enderman place:
  15. if world of event-block is "TD":
  16. cancel event
  17.  
  18.  
  19. on enderman pickup:
  20. if world of event-block is "TD":
  21. cancel event
  22.  
  23.  
  24. on place:
  25. if world of event-block is "TD":
  26. if {TD::edittingmap::%player%} is not set:
  27. cancel event
  28. stop
  29.  
  30. else:
  31. set {TD::blockLoc::%{Count}%} to location of event-block
  32. set {TD::blockType::%{Count}%} to type of event-block
  33. set {TD::cancelBreak::%location of event-block%} to true
  34. set {TD::cancelBreak::num::%location of event-block%} to {Count}
  35. add 1 to {Count}
  36.  
  37.  
  38.  
  39. on break:
  40. if world of event-block is "TD":
  41. if {TD::edittingmap::%player%} is not set:
  42. if {TD::cancelBreak::%location of event-block%} is true:
  43. cancel event
  44. stop
  45.  
  46. else:
  47. if {TD::cancelBreak::%location of event-block%} is true:
  48. delete {TD::blockLoc::%{TD::cancelBreak::num::%location of event-block%}%}
  49. delete {TD::blockType::%{TD::cancelBreak::num::%location of event-block%}%}
  50. delete {TD::cancelBreak::%location of event-block%}
  51. delete {TD::cancelBreak::num::%location of event-block%}
  52. remove 1 from {Count}
  53.  
  54.  
  55.  
  56. on rightclick:
  57. if clicked block is a sign:
  58. if {TD::wSign::%location of clicked block%} is set:
  59. set {_name} to {TD::wSign::%location of clicked block%}
  60. set {_warp} to {TD::wSign::%{_name}%::warp}
  61.  
  62.  
  63.  
  64. teleport player to {TD::warps::%{_warp}%}
  65.  
  66. #make spawned entity pathfind to player with speed 0.5
  67.  
  68. #Wave command
  69. #Setcastle command
  70.  
  71. every 10 tick:
  72. loop all entities in world "TD":
  73. if name of loop-value is "&2Zombie :: 1":
  74. if distance between loop-value and {loc2} is smaller than 2:
  75. kill loop-value
  76.  
  77. if {removed} is not set:
  78. set {removed} to false
  79.  
  80. send "%{removed}%" to all players in world "TD"
  81.  
  82. if {removed} is false:
  83. set {removed} to true
  84.  
  85. set {health} to {health}-1
  86. #send "{@prefix} &4Health: &f%{TD::map::%%::%team%}-1%"
  87.  
  88. if {health} is more than 0:
  89. send "{@prefix} &4Health: &f%{health}%" to all players in world "TD"
  90.  
  91. else:
  92. send "{@prefix} &4Je hebt verloren!" to all players in world "TD"
  93. delete {health}
  94.  
  95. set {removed} to false
  96. stop loop
  97.  
  98.  
  99. else:
  100. make loop-value pathfind to {loc2} with speed 1
  101. #send "%loop-value%" to console
  102.  
  103. #Detect name of entity
  104.  
  105. #if loop-value is "zombie":
  106. # send "Pathfinding..." to console
  107. # make loop-value pathfind to {loc2} with speed 0.5
  108.  
  109.  
  110.  
  111. command /wave [<text>]:
  112. trigger:
  113. if player has permission "TD.startWave":
  114. if {health} is not set:
  115. set {health} to 10
  116.  
  117.  
  118. if {health} is 0:
  119. set {health} to 10
  120.  
  121. set {loc2} to location at -1, 96, -8
  122. #stop
  123. set {_loc} to location at -1, 97, 6
  124. #set {loc2} to location of player
  125. spawn zombie pigman at {_loc}
  126. set name of last spawned zombie pigman to "&2Zombie :: %arg 1%"
  127.  
  128.  
  129. #add spawned entity to {TD::waveEntities::*}
  130.  
  131. #while spawned entity exists:
  132. # if distance between player and spawned entity is greater than 2:
  133. # make spawned entity pathfind to player with speed 0.5
  134. # wait a tick
  135.  
  136. #wait 1 second
  137.  
  138. #spawn zombie at {_loc}
  139. #set name of last spawned zombie to "&2Zombie"
  140. #while spawned entity exists:
  141. # if distance between player and spawned entity is greater than 2:
  142. # make spawned entity pathfind to player with speed 0.5
  143. # wait a tick
  144. #wait 1 second
  145.  
  146. #spawn zombie at {_loc}
  147. #set name of last spawned zombie to "&2Zombie"
  148. #while spawned entity exists:
  149. # if distance between player and spawned entity is greater than 2:
  150. # make spawned entity pathfind to player with speed 0.5
  151. # wait a tick
  152.  
  153. #wait 1 second
  154.  
  155. #spawn zombie at {_loc}
  156. #set name of last spawned zombie to "&2Zombie"
  157. #while spawned entity exists:
  158. # if distance between player and spawned entity is greater than 2:
  159. # make spawned entity pathfind to player with speed 0.5
  160. # wait a tick
  161.  
  162. #wait 1 second
  163.  
  164. #spawn zombie at {_loc}
  165. #set name of last spawned zombie to "&2Zombie"
  166. #while spawned entity exists:
  167. # if distance between player and spawned entity is greater than 2:
  168. # make spawned entity pathfind to player with speed 0.5
  169. # wait a tick
  170.  
  171.  
  172.  
  173. command /editmap [<offline player>]:
  174. trigger:
  175. if arg 1 is not set:
  176. if player has permission "TD.editmap":
  177.  
  178. if {TD::edittingmap::%player%} is not set:
  179. set {TD::edittingmap::%player%} to true
  180. send "{@mprefix} Je kan de map nu bewerken."
  181.  
  182. else:
  183. clear {TD::edittingmap::%player%}
  184. send "{@mprefix} Je kan de map niet meer bewerken."
  185.  
  186. else:
  187. send "{@mprefix} &4Je hebt hier &convoldoende permissies &4voor!"
  188.  
  189. else:
  190.  
  191. if player has permission "TD.editmap.others":
  192. if {TD::edittingmap::%arg-1%} is not set:
  193. set {TD::edittingmap::%arg-1%} to true
  194.  
  195. if arg-1 is player:
  196. send "{@mprefix} Je kan de map nu bewerken."
  197.  
  198. else:
  199. send "{@mprefix} Je kan de map nu bewerken." to arg 1
  200. send "{@mprefix} De speler &l%arg 1% &fkan de map nu bewerken."
  201.  
  202. else:
  203. clear {TD::edittingmap::%arg-1%}
  204.  
  205. if arg-1 is player:
  206. send "{@mprefix} Je kan de map niet meer bewerken."
  207.  
  208. else:
  209. send "{@mprefix} Je kan de map niet meer bewerken." to arg 1
  210. send "{@mprefix} De speler &l%arg 1% &fkan de map niet meer bewerken."
  211.  
  212. else:
  213. send "{@mprefix} &4Je hebt hier &convoldoende permissies &4voor!"
  214.  
  215.  
  216. command /reset:
  217. trigger:
  218. if player has permission "TD.resetmap":
  219.  
  220. if {TD::reset::%player%} is true:
  221. send "{@mprefix} &4Je bent de map al aan het resetten."
  222.  
  223. else:
  224. set {TD::reset::%player%} to true
  225. send "{@mprefix} De map aan het resetten..."
  226.  
  227. loop {Count} times:
  228. set {Count} to loop-value
  229. set block at location of {TD::blockLoc::%{Count}%} to {TD::blockType::%{Count}%}
  230.  
  231. wait 10 ticks
  232. delete {TD::reset::%player%}
  233. send "{@mprefix} Map gereset!"
  234. else:
  235. send "{@mprefix} &4Je hebt hier &convoldoende permissies &4voor!"
  236.  
  237. # 1 -> create/remove, 2 -> mapnaam, 3 -> warp (bij create), 4 -> spelers (bij create)
  238. # 1 -> setwarp, 2 -> naam
  239. # 1 -> warplist
  240. command /sign [<text>] [<text>] [<text>] [<text>]:
  241. trigger:
  242. if player has permission "TD.joinsign":
  243. if arg 1 is "setwarp":
  244. if arg 2 is set:
  245. if {TD::warpList::*} doesn't contain "%arg 2%":
  246. send "{@mprefix} Warp %arg 2% gemaakt!"
  247.  
  248. add arg 2 to {TD::warpList::*}
  249. set {TD::warps::%arg 2%} to location of player
  250. set {_name} to arg 2
  251.  
  252. else:
  253. send "{@mprefix} &4De warp &c%arg 2% &4is al in gebruik."
  254.  
  255. else:
  256. send "{@mprefix} &4Je moet nog een &cwarpnaam &4opgeven."
  257.  
  258. else if arg 1 is "warplist":
  259. if {TD::warpList::*} is not empty:
  260. send "{@mprefix} Dit is de lijst met alle warps:%nl%%{TD::warpList::*}%"
  261. else:
  262. send "{@mprefix} Er zijn geen warps."
  263.  
  264. else if arg 1 is "create":
  265. if targeted block is not a sign:
  266. send "{@mprefix} &4Een join sign kan alleen een sign zijn."
  267.  
  268. else if {TD::%location of targeted block%} is set:
  269. send "{@mprefix} &4Het getargete blok is al een join sign."
  270.  
  271. else if arg 2 is set:
  272. if {TD::signList::*} contains arg 2:
  273. send "{@mprefix} &4De naam &c%arg 2% &4is al in gebruik."
  274.  
  275. else:
  276. if arg 3 is set:
  277. send "%{TD::warpList::*}%"
  278. if {TD::warpList::*} doesn't contain arg 3:
  279. send "{@mprefix} &4De warp &c%arg 3% &4bestaat niet."
  280.  
  281.  
  282.  
  283. else:
  284. if arg 4 is set:
  285. send "{@mprefix} Join sign gemaakt met de volgende eigenschappen:%nl%&fNaam: %arg 2%%nl%&fWarp: %arg 3%%nl%&fSpelers: %arg 4%"
  286. add arg 2 to {TD::signList::*}
  287. set {TD::wSign::%location of targeted block%} to arg 2
  288. set {TD::wSign::%arg 2%::warp} to arg 3
  289. set {TD::wSign::%arg 2%::maxP} to arg 4
  290.  
  291.  
  292. else:
  293. send "{@mprefix} &4Je moet nog een &caantal spelers &4opgeven."
  294.  
  295.  
  296.  
  297. else:
  298. send "{@mprefix} &4Je moet nog een &cwarp &4en &caantal spelers &4opgeven."
  299. else:
  300. send "{@mprefix} &4Je moet nog een &cnaam, warp &4en &caantal spelers &4opgeven."
  301.  
  302.  
  303. else if arg 1 is "remove":
  304. if targeted block is not a sign:
  305. send "{@mprefix} &4Een join sign kan alleen een sign zijn."
  306.  
  307. else:
  308. send "{@mprefix} Join sign aan het verwijderen..."
  309.  
  310. set {_name} to {TD::wSign::%location of targeted block%}
  311.  
  312. remove {_name} from {TD::signList::*}
  313. delete {TD::wSign::%location of targeted block%}
  314. delete {TD::wSign::%{_name}%::warp}
  315. delete {TD::wSign::%{_name}%::maxP}
  316.  
  317. wait 3 ticks
  318.  
  319. send "{@mprefix} Join sign verwijderd!"
  320.  
  321. else if arg 1 is set:
  322. send "{@mprefix} &4Het argument &c%arg 1% &4is ongeldig, kies uit de volgende argumenten: &ccreate, remove &4of &csetwarp&4."
  323.  
  324. else:
  325. send "{@mprefix} &4Je moet nog opgeven wat je wil doen, &ccreate, remove &4of &csetwarp&4."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement