knugi

Untitled

Mar 17th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. options:
  2. tag: &8[&9Duels&8]
  3. folder: plugins/Duels
  4.  
  5. on script load:
  6. if folder "{@folder}" doesn't exists:
  7. create folder "{@folder}"
  8. create folder "{@folder}/kits"
  9. create folder "{@folder}/arens"
  10. create folder "{@folder}/users"
  11. create file "{@folder}/config.yml"
  12.  
  13.  
  14. command /duel [<player>]:
  15. trigger:
  16. if arg 1 isn't set:
  17. send "{@tag} &cPodaj gracza z ktorym chcesz walczyc."
  18. stop
  19. if player-arg 1 is online:
  20. if file "{@folder}/%player%.yml" doesn't exists:
  21. if file "{@folder}/%arg 1%.yml" doesn't exists:
  22. open chest with 3 rows named "&eWybierz zestaw" to player
  23. set {_i} to 0
  24. loop 10 times:
  25. set player's current inventory's slot {_i} to gray glass pane named " "
  26. add 1 to {_i}
  27. set {_c} to 17
  28. loop 10 times:
  29. set player's current inventory's slot {_c} to gray glass pane named " "
  30. add 1 to {_c}
  31. set {_x::*} to files in "{@folder}/kits"
  32. #10-17
  33. set {_i} to 10
  34. loop 7 times:
  35. set {_name} to {_x::%loop-number%}
  36. replace all ".yml" with "" in {_name}
  37. set player's current inventory's slot {_i} to diamond sword named "&c%{_name}%"
  38. else:
  39. send "{@tag} &cTen gracz jest juz podczas walki."
  40. stop
  41. else:
  42. send "{@tag} &cJestes juz podczas walki."
  43. stop
  44. else:
  45. send "{@tag} &cTen gracz jest offline."
  46. stop
  47. on inventory click:
  48. if "%inventory name of player's current inventory%" contains "Wybierz zestaw":
  49. if slot is smaller than 0:
  50. stop
  51. cancel event
  52. if player's current inventory's slot slot is diamond sword:
  53. set {_kit} to uncoloured name of player's current inventory's slot slot
  54. #Kod na wybor kitu....
  55. command /zestaw [<text>] [<text>] [<text>]:
  56. trigger:
  57. if player has permission "duels.*" or "duels.kit":
  58. if arg 1 isn't set:
  59. send "{@tag} &cPoprawne uzycie: &7/zestaw <add/remove/info/item/daj> <nazwaZestawu> *<przedmiot>*"
  60. stop
  61. if arg 1 is "add" or "set":
  62. if arg 2 is set:
  63. if arg 2's length is bigger than or equal to 3:
  64. create file "{@folder}/kits/%arg 2%.yml"
  65. set {_n} to arg 2
  66. set "kit.nazwa" to "%{_n}%" in yaml file "{@folder}/kits/%arg 2%.yml"
  67. set {_i} to 1
  68. loop all items in player's inventory:
  69. set "kit.items.%{_i}%" to "%loop-item%" in yaml file "{@folder}/kits/%arg 2%.yml"
  70. add 1 to {_i}
  71. set "kit.autor" to "%player%" in yaml file "{@folder}/kits/%arg 2%.yml"
  72. set "kit.item" to "stick" in yaml file "{@folder}/kits/%arg 2%.yml"
  73. send "{@tag} &aStworzyles nowy zestaw o nazwie: &1%arg 2%"
  74. stop
  75. else:
  76. send "{@tag} &cNazwa musi zawierac min. 3 znaki."
  77. stop
  78. if arg 1 is "info":
  79. if arg 2 is set:
  80. if file "{@folder}/kits/%arg 2%.yml" exists:
  81. send ""
  82. send "&eZestaw: &7%arg 2%"
  83. set {_n} to single value "kit.nazwa" get of "{@folder}/kits/%arg 2%.yml"
  84. set {_c::*} to configuration section "kit.items" get of "{@folder}/kits/%arg 2%.yml"
  85. loop {_c::*}:
  86. add single value "kit.items.%loop-index%" get of "{@folder}/kits/%arg 2%.yml" to {_items::*}
  87. set {_b} to single value "kit.autor" get of "{@folder}/kits/%arg 2%.yml"
  88. send "&eNazwa: &7%{_n}%"
  89. send "&ePrzedmioty: &7%{_items::*}%"
  90. send "&eAutor: &7%{_b}%"
  91. else:
  92. set {_kitsy::*} to all files in "{@folder}/kits"
  93. loop {_kitsy::*}:
  94. replace all ".yml" in {_kitsy::%loop-index%} with ""
  95. send "{@tag} &cDostepne zestawy: &7%{_kitsy::*}%"
  96. if arg 1 is "daj":
  97. if arg 2 is set:
  98. if file "{@folder}/kits/%arg 2%.yml" exists:
  99. set {_its::*} to configuration section "kit.items" get of "{@folder}/kits/%arg 2%.yml"
  100. loop {_its::*}:
  101. set {_i} to single value "kit.items.%loop-index%" get of "{@folder}/kits/%arg 2%.yml" parsed as item type
  102. send "%{_i}%"
  103. give {_i} to player
  104. send "{@tag} &aOtrzymales zestaw &7%arg 2%"
  105. else:
  106. set {_kitsy::*} to all files in "{@folder}/kits"
  107. loop {_kitsy::*}:
  108. replace all ".yml" in {_kitsy::%loop-index%} with ""
  109. if {_kitsy::*} is not set:
  110. add "-" to {_kitsy::*}
  111. send "{@tag} &cDostepne zestawy: &7%{_kitsy::*}%"
  112. if arg 1 is "item":
  113. if arg 2 is set:
  114. if file "{@folder}/kits/%arg 2%.yml" exists:
  115. if arg 3 is set:
  116. if arg 3 parsed as item type is item:
  117. set "kit.item" to "%arg 3%" in yaml file "{@folder}/kits/%arg 3%.yml"
  118. send "{@tag} &aUstawiles przedmiot zestawu &7%arg 2% &ana &7%arg 3%"
  119. stop
  120. else:
  121. send "{@tag} &7%arg 3% &cnie jest typem przedmiotu."
  122. stop
  123. else:
  124. send "{@tag} &cPoprawne uzycie: &7/zestaw item <zestaw> <przedmiot>"
  125. stop
  126. else:
  127. send "{@folder} &cPodany zestaw nie istnieje."
  128. stop
  129. else:
  130. send "{@tag} &cPoprawne uzycie: &7/zestaw item <zestaw> <przedmiot>"
  131. stop
Advertisement
Add Comment
Please, Sign In to add comment