ggdu490

Skript porte

Sep 14th, 2016
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.42 KB | None | 0 0
  1. options:
  2. logo: &4[&ePorte&4] : &r #Prefix chat
  3. blocks: horizontal pillar quartz block #Bloc a utilisé a la base de la porte
  4. blanc: white glass pane #Choix de la vitre
  5. noir: black glass pane #Choix de la vitre
  6. gris: gray glass pane #Choix de la vitre
  7. grisc: light gray glass pane #Choix de la vitre
  8. bleue: blue glass pane #Choix de la vitre
  9. delvitre: white glass pane or black glass pane or gray glass pane or light gray glass pane or blue glass pane
  10. rayon: 5 #Rayon d'action entre le panneau et l'option blocks défini plus haut
  11.  
  12. on rightclick on a sign:
  13. if line 1 is "&e[Porte]":
  14. if line 3 is "Ouvrir":
  15. if {x_porte_.allow.%location of targeted block%::*} doesn't contain player:
  16. cancel event
  17. else:
  18. loop blocks in radius 3 around event-block:
  19. loop-block is a sign:
  20. wait 1 tick
  21. if line 1 is "&e[Porte]":
  22. wait 3 ticks
  23. set line 3 of loop-block to "Fermer"
  24. else if line 3 is "Fermer":
  25. if {x_porte_.allow.%location of targeted block%::*} doesn't contain player:
  26. cancel event
  27. else:
  28. loop blocks in radius 3 around event-block:
  29. loop-block is a sign:
  30. wait 1 tick
  31. if line 1 is "&e[Porte]":
  32. wait 3 ticks
  33. set line 3 of loop-block to "Ouvrir"
  34.  
  35. on rightclick on a sign:
  36. if line 1 is "&e[Porte]":
  37. if gamemode of player is survival:
  38. set {_allow::*} to value list "Joueurs autorisés" get of "plugins/Porte/%event-location%.yml"
  39. if {_allow::*} doesn't contain player:
  40. cancel event
  41. message "{@logo}&4Tu n'es pas autorisé a utiliser cette porte"
  42. else:
  43. if line 2 is "2":
  44. if line 3 is "Fermer":
  45. set line 3 to "Ouvrir"
  46. loop blocks in radius {@rayon} around event-block:
  47. loop-block is {@blocks}:
  48. if line 4 is "" or "blanc":
  49. wait 10 ticks
  50. set block 2 meter above loop-block to {@blanc}
  51. set block 1 meter above loop-block to {@blanc}
  52. if line 4 is "noir":
  53. wait 10 ticks
  54. set block 2 meter above loop-block to {@noir}
  55. set block 1 meter above loop-block to {@noir}
  56. if line 4 is "gris":
  57. wait 10 ticks
  58. set block 2 meter above loop-block to {@gris}
  59. set block 1 meter above loop-block to {@gris}
  60. if line 4 is "grisc":
  61. wait 10 ticks
  62. set block 2 meter above loop-block to {@grisc}
  63. set block 1 meter above loop-block to {@grisc}
  64. if line 4 is "bleue":
  65. wait 10 ticks
  66. set block 2 meter above loop-block to {@bleue}
  67. set block 1 meter above loop-block to {@bleue}
  68.  
  69. stop
  70. if line 3 is "Ouvrir":
  71. set line 3 to "Fermer"
  72. loop blocks in radius {@rayon} around event-block:
  73. loop-block is {@blocks}:
  74. wait 10 ticks
  75. set block 2 meter above loop-block to air
  76. set block 1 meter above loop-block to air
  77. stop
  78.  
  79.  
  80. if line 2 is "3":
  81. if line 3 is "Fermer":
  82. set line 3 to "Ouvrir"
  83. loop blocks in radius {@rayon} around event-block:
  84. loop-block is {@blocks}:
  85. block above loop-block is air
  86. if line 4 is "" or "blanc":
  87. wait 10 ticks
  88. set block 3 meter above loop-block to {@blanc}
  89. set block 2 meter above loop-block to {@blanc}
  90. set block 1 meter above loop-block to {@blanc}
  91. if line 4 is "noir":
  92. wait 10 ticks
  93. set block 3 meter above loop-block to {@noir}
  94. set block 2 meter above loop-block to {@noir}
  95. set block 1 meter above loop-block to {@noir}
  96. if line 4 is "gris":
  97. wait 10 ticks
  98. set block 3 meter above loop-block to {@gris}
  99. set block 2 meter above loop-block to {@gris}
  100. set block 1 meter above loop-block to {@gris}
  101. if line 4 is "grisc":
  102. wait 10 ticks
  103. set block 3 meter above loop-block to {@grisc}
  104. set block 2 meter above loop-block to {@grisc}
  105. set block 1 meter above loop-block to {@grisc}
  106. if line 4 is "bleue":
  107. wait 10 ticks
  108. set block 3 meter above loop-block to {@bleue}
  109. set block 2 meter above loop-block to {@bleue}
  110. set block 1 meter above loop-block to {@bleue}
  111. stop
  112.  
  113. if line 3 is "Ouvrir":
  114. set line 3 to "Fermer"
  115. loop blocks in radius {@rayon} around event-block:
  116. loop-block is {@blocks}:
  117. block above loop-block is {@delvitre}
  118. wait 10 ticks
  119. set block 3 meter above loop-block to air
  120. set block 2 meter above loop-block to air
  121. set block 1 meter above loop-block to air
  122.  
  123. stop
  124.  
  125.  
  126. if line 2 is "barriere2":
  127. if line 3 is "Fermer":
  128. set line 3 to "Ouvrir"
  129. loop blocks in radius {@rayon} around event-block:
  130. loop-block is cobblestone:
  131. wait 10 ticks
  132. set block 2 meter above loop-block to fence
  133. set block 1 meter above loop-block to fence
  134.  
  135. stop
  136. if line 3 is "Ouvrir":
  137. set line 3 to "Fermer"
  138. loop blocks in radius {@rayon} around event-block:
  139. loop-block is cobblestone:
  140. block above loop-block is fence
  141. wait 10 ticks
  142. set block 2 meter above loop-block to air
  143. set block 1 meter above loop-block to air
  144. stop
  145. else:
  146. if line 2 is "2":
  147. if line 3 is "Fermer":
  148. set line 3 to "Ouvrir"
  149. loop blocks in radius {@rayon} around event-block:
  150. loop-block is {@blocks}:
  151. if line 4 is "" or "blanc":
  152. wait 10 ticks
  153. set block 2 meter above loop-block to {@blanc}
  154. set block 1 meter above loop-block to {@blanc}
  155. if line 4 is "noir":
  156. wait 10 ticks
  157. set block 2 meter above loop-block to {@noir}
  158. set block 1 meter above loop-block to {@noir}
  159. if line 4 is "gris":
  160. wait 10 ticks
  161. set block 2 meter above loop-block to {@gris}
  162. set block 1 meter above loop-block to {@gris}
  163. if line 4 is "grisc":
  164. wait 10 ticks
  165. set block 2 meter above loop-block to {@grisc}
  166. set block 1 meter above loop-block to {@grisc}
  167. if line 4 is "bleue":
  168. wait 10 ticks
  169. set block 2 meter above loop-block to {@bleue}
  170. set block 1 meter above loop-block to {@bleue}
  171.  
  172. stop
  173. if line 3 is "Ouvrir":
  174. set line 3 to "Fermer"
  175. loop blocks in radius {@rayon} around event-block:
  176. loop-block is {@blocks}:
  177. wait 10 ticks
  178. set block 2 meter above loop-block to air
  179. set block 1 meter above loop-block to air
  180. stop
  181.  
  182.  
  183. if line 2 is "3":
  184. if line 3 is "Fermer":
  185. set line 3 to "Ouvrir"
  186. loop blocks in radius {@rayon} around event-block:
  187. loop-block is {@blocks}:
  188. block above loop-block is air
  189. if line 4 is "" or "blanc":
  190. wait 10 ticks
  191. set block 3 meter above loop-block to {@blanc}
  192. set block 2 meter above loop-block to {@blanc}
  193. set block 1 meter above loop-block to {@blanc}
  194. if line 4 is "noir":
  195. wait 10 ticks
  196. set block 3 meter above loop-block to {@noir}
  197. set block 2 meter above loop-block to {@noir}
  198. set block 1 meter above loop-block to {@noir}
  199. if line 4 is "gris":
  200. wait 10 ticks
  201. set block 3 meter above loop-block to {@gris}
  202. set block 2 meter above loop-block to {@gris}
  203. set block 1 meter above loop-block to {@gris}
  204. if line 4 is "grisc":
  205. wait 10 ticks
  206. set block 3 meter above loop-block to {@grisc}
  207. set block 2 meter above loop-block to {@grisc}
  208. set block 1 meter above loop-block to {@grisc}
  209. if line 4 is "bleue":
  210. wait 10 ticks
  211. set block 3 meter above loop-block to {@bleue}
  212. set block 2 meter above loop-block to {@bleue}
  213. set block 1 meter above loop-block to {@bleue}
  214. stop
  215.  
  216. if line 3 is "Ouvrir":
  217. set line 3 to "Fermer"
  218. loop blocks in radius {@rayon} around event-block:
  219. loop-block is {@blocks}:
  220. block above loop-block is {@delvitre}
  221. wait 10 ticks
  222. set block 3 meter above loop-block to air
  223. set block 2 meter above loop-block to air
  224. set block 1 meter above loop-block to air
  225.  
  226. stop
  227.  
  228.  
  229. if line 2 is "barriere2":
  230. if line 3 is "Fermer":
  231. set line 3 to "Ouvrir"
  232. loop blocks in radius {@rayon} around event-block:
  233. loop-block is cobblestone:
  234. wait 10 ticks
  235. set block 2 meter above loop-block to fence
  236. set block 1 meter above loop-block to fence
  237.  
  238. stop
  239. if line 3 is "Ouvrir":
  240. set line 3 to "Fermer"
  241. loop blocks in radius {@rayon} around event-block:
  242. loop-block is cobblestone:
  243. block above loop-block is fence
  244. wait 10 ticks
  245. set block 2 meter above loop-block to air
  246. set block 1 meter above loop-block to air
  247. stop
  248.  
  249.  
  250. on break:
  251. if player's gamemode is survival:
  252. if block is {@delvitre}:
  253. loop blocks in radius {@rayon} around event-block:
  254. loop-block is sign:
  255. if line 1 of loop-block is "&e[Porte]":
  256. cancel event
  257.  
  258. command /modoporte <text> <text>:
  259. permission: sk.modo
  260. trigger:
  261. if arg 1 is "add":
  262. if arg 2 is set:
  263. add arg 2 to {x_porte_.owner.%location of targeted block%::*}
  264. else:
  265. send "{@logo}&4Vous devez indiquez un joueur"
  266. if arg 1 is "del":
  267. if arg 2 is set:
  268. remove arg 2 from {x_porte_.owner.%location of targeted block%::*}
  269. else:
  270. send "{@logo}&4Vous devez indiquez un joueur"
  271.  
  272.  
  273. command /porte <text> [<text>]:
  274. trigger:
  275. if targeted block is a sign:
  276. if line 1 of targeted block is "&e[Porte]":
  277. if arg 1 is "add":
  278. if player has permission "sk.modo":
  279. add arg 2 to {x_porte_.allow.%location of targeted block%::*}
  280. send "{@logo}&e%arg 2% &9 a été ajouté sur cette porte"
  281. else if {x_porte_.owner.%location of targeted block%::*} contains player:
  282. add arg 2 to {x_porte_.allow.%location of targeted block%::*}
  283. send "{@logo}&e%arg 2% &9 a été ajouté sur cette porte"
  284. else:
  285. send "{@logo}&9Tu n'es pas le propriétaire de cette porte. Tu ne peux pas ajouter de joueurs."
  286. if arg 1 is "del":
  287. if player has permission "sk.modo":
  288. remove arg 2 from {x_porte_.allow.%location of targeted block%::*}
  289. send "{@logo}&e%arg 2% &9 a été supprimé sur cette porte"
  290. else if {x_porte_.owner.%location of targeted block%::*} contains player:
  291. remove arg 2 from {x_porte_.allow.%location of targeted block%::*}
  292. send "{@logo}&e%arg 2% &9 a été supprimé sur cette porte"
  293. else:
  294. send "{@logo}&9Tu n'es pas le propriétaire de cette porte. Tu ne peux pas supprimer de joueurs."
  295. if arg 1 is "list":
  296. if player has permission "sk.modo":
  297. send "{@logo}&ePropriétaire: &9%{x_porte_.owner.%location of targeted block%::*}%"
  298. send "{@logo}&eListe des joueurs autorisés: &9%{x_porte_.allow.%location of targeted block%::*}%"
  299. else if {x_porte_.owner.%location of targeted block%::*} contains player:
  300. send "{@logo}&eListe des joueurs autorisés: &9%{x_porte_.allow.%location of targeted block%::*}%"
  301.  
  302. else:
  303. send "{@logo}&9Tu n'es pas le propriétaire de cette porte. Tu ne peux pas voir la liste des joueurs allow."
  304.  
  305. on sign change:
  306. if line 1 is "[Porte]":
  307. if line 2 is "":
  308. set line 1 to "&e[Porte]"
  309. set line 2 to "2"
  310. set line 3 to "Fermer"
  311. add event-location to {x_porte_.owner.%event-location%::*}
  312. add player to {x_porte_.owner.%event-location%::*}
  313. add player to {x_porte_.allow.%event-location%::*}
  314. send "{@logo}&9Le panneau a été créer"
  315.  
  316. on break:
  317. if block is a sign:
  318. if line 1 is "&e[porte]":
  319. if {x_porte_.owner.%event-location%::*} doesn't contain player:
  320. cancel event
  321. send "{@logo} &4Tu ne peux pas détruire une porte qui ne t'appartiens pas."
  322. else:
  323. delete {x_porte_.owner.%event-location%::*}
  324. delete {x_porte_.allow.%event-location%::*}
  325. send "{@logo}&9Le panneau a été supprimé"
  326.  
  327. on sign change:
  328. if line 1 is "[Porte]":
  329. if line 2 is "2":
  330. set line 1 to "&e[Porte]"
  331. set line 3 to "Fermer"
  332. set {_loc} to location of event-block
  333. set {_x} to single value "x" get of "../../Porte/Liste.yml"
  334. set {_y} to single value "y" get of "../../Porte/Liste.yml"
  335. set {_z} to single value "z" get of "../../Porte/Liste.yml"
  336. set x-location of {_loc} to {_x} parsed as number
  337. set y-location of {_loc} to {_y} parsed as number
  338. set z-location of {_loc} to {_z} parsed as number
  339. broadcast "%{_loc}%"
  340. add "%player%" to yaml list "%event-location%.owner" from file "../../Porte/Liste.yml"
  341. add "%player%" to yaml list "%event-location%.allow" from file "../../Porte/Liste.yml"
  342. send "{@logo}&9Le panneau a été créer"
  343.  
  344. command /test <text>:
  345. trigger:
  346. delete folder "../../Porte/Liste.yml"
  347.  
  348. on sign change:
  349. if line 1 is "[Porte]":
  350. if line 2 is "3":
  351. set line 1 to "&e[Porte]"
  352. set line 3 to "Fermer"
  353. add event-location to {x_porte_.owner.%event-location%::*}
  354. add player to {x_porte_.owner.%event-location%::*}
  355. add player to {x_porte_.allow.%event-location%::*}
  356. send "{@logo}&9Le panneau a été créer"
  357.  
  358.  
  359. on sign change:
  360. if line 1 is "test":
  361. set line 3 to "Fermer"
  362.  
  363.  
  364. on leftclick on a sign:
  365. if line 1 is "&e[Porte]":
  366. wait 2 ticks
  367. if player's tool is black dye:
  368. set line 4 to "noir"
  369. if player's gamemode is survival:
  370. remove 1 black dye from player
  371. if player's tool is gray dye:
  372. set line 4 to "gris"
  373. if player's gamemode is survival:
  374. remove 1 gray dye from player
  375. if player's tool is light gray dye:
  376. set line 4 to "grisc"
  377. if player's gamemode is survival:
  378. remove 1 light gray dye from player
  379. if player's tool is Lapis Lazuli:
  380. set line 4 to "bleue"
  381. if player's gamemode is survival:
  382. remove 1 Lapis Lazuli from player
  383. if player's tool is white dye:
  384. set line 4 to "blanc"
  385. if player's gamemode is survival:
  386. remove 1 white dye from player
  387.  
  388. on break a sign:
  389. if player's gamemode is creative:
  390. if line 1 is "&e[Porte]":
  391. if player's tool is black dye:
  392. cancel event
  393. if player's tool is gray dye:
  394. cancel event
  395. if player's tool is light gray dye:
  396. cancel event
  397. if player's tool is Lapis Lazuli:
  398. cancel event
  399. if player's tool is white dye:
  400. cancel event
  401. #==================================================
  402. #on rightclick on a sign:
  403. # if line 1 is "&e[Porte]":
  404. # if "%owner of region at player%" or "%members of region at player%" contains "%player%":
  405. # if line 2 is "barriere2":
  406. # if line 3 is "Fermer":
  407. # set line 3 to "Ouvrir"
  408. # loop blocks in radius {@rayon} around event-block:
  409. # loop-block is cobblestone:
  410. # wait 10 ticks
  411. # set block 2 meter above loop-block to fence
  412. # set block 1 meter above loop-block to fence
  413. #
  414. # stop
  415. # if line 3 is "Ouvrir":
  416. # set line 3 to "Fermer"
  417. # loop blocks in radius {@rayon} around event-block:
  418. # loop-block is cobblestone:
  419. # block above loop-block is fence
  420. # wait 10 ticks
  421. # set block 2 meter above loop-block to air
  422. # set block 1 meter above loop-block to air
  423. # stop
  424.  
  425.  
  426. on load:
  427. if folder "plugins/Porte" doesn't exists:
  428. send "&e&lLe dossier plugins/Porte n'existe pas !" to console
  429. send " &aCréation du dossier en cours..." to console
  430. create folder "plugins/Porte"
  431. send "&2Dossier créer" to console
Advertisement
Add Comment
Please, Sign In to add comment