Guest User

Untitled

a guest
Jun 21st, 2015
2,740
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.20 KB | None | 0 0
  1.  
  2. # PETY by MiniGameShoot
  3. # Proszę tego nie usuwać!
  4.  
  5. on script load:
  6. if folder "plugins/Skript/scripts/pety" doesn't exists:
  7. create folder "plugins/Skript/scripts/pety"
  8. if file "plugins/Skript/scripts/pety/config.yml" doesn't exists:
  9. create file "plugins/Skript/scripts/pety/config.yml"
  10. #wf "pety:" to "plugins/Skript/scripts/pety/config.yml"
  11. #wf "- 'wolf'" to "plugins/Skript/scripts/pety/config.yml"
  12. #wf "- 'pig'" to "plugins/Skript/scripts/pety/config.yml"
  13. #wf "- 'sheep'" to "plugins/Skript/scripts/pety/config.yml"
  14. set yaml value "wysokosctabeli" from "pety/config.yml" to "4"
  15. set yaml value "pety.pig.create" from "pety/config.yml" to "true"
  16. set yaml value "pety.pig.lore" from "pety/config.yml" to "&eTo jest podstawowy opis || pig "
  17. set yaml value "pety.wolf.create" from "pety/config.yml" to "true"
  18. set yaml value "pety.wolf.lore" from "pety/config.yml" to "&eTo jest podstawowy opis || wolf "
  19. set yaml value "pety.sheep.create" from "pety/config.yml" to "true"
  20. set yaml value "pety.sheep.lore" from "pety/config.yml" to "&eTo jest podstawowy opis || sheep "
  21. if file "plugins/Skript/scripts/pety/gracze.yml" doesn't exists:
  22. create file "plugins/Skript/scripts/pety/gracze.yml"
  23. on first join:
  24. set yaml value "%name of player%.nazwapeta" from "pety/gracze.yml" to "%name of player%"
  25.  
  26. on join:
  27. set yaml value "%name of player%.online" from "pety/gracze.yml" to "true"
  28. set yaml value "%name of player%.nazywa" from "pety/gracze.yml" to "false"
  29. set yaml value "%name of player%.ruch" from "pety/gracze.yml" to "true"
  30. if slot 8 of player is air:
  31. wait tick
  32. set slot 8 of player to bone named "&aPety"
  33. on quit:
  34. set yaml value "%name of player%.online" from "pety/gracze.yml" to "false"
  35. loop all entities:
  36. if {pet::%loop-entity%} is set:
  37. set {_petname} to yaml value "%player%.nazwapeta" from "pety/gracze.yml"
  38. if name of loop-entity is {_petname}:
  39. kill loop-entity
  40. command /ustawpet:
  41. trigger:
  42. set yaml value "%name of player%.nazwapeta" from "pety/gracze.yml" to "%name of player%"
  43.  
  44. on right click:
  45. if player's tool is bone named "&aPety":
  46. wait tick
  47. function "pety.gui" {player};
  48. on right click on entity:
  49. if {pet::%clicked entity%} is set:
  50. if {pet::%clicked entity%} = name of player:
  51. wait 1 tick
  52. open chest with 1 rows named "&eMenu Peta" to player
  53. wait 1 tick
  54. format slot 0 of player with 1 of minecart named "&bJazda" with lore "&eKliknij, aby jezdzic || na swoim pecie" to close then run "sudo %player% pety jazda"
  55. format slot 1 of player with 1 of name tag named "&bNazwij" with lore "&eKliknij, aby nazwac || peta" to close then run "sudo %player% pety nazwij"
  56. format slot 2 of player with 1 of green wool named "&bPodazaj" with lore "&eKliknij, aby pet za toba || chodzil" to close then run "sudo %player% pety ruch"
  57. format slot 3 of player with 1 of red wool named "&bZatrzymaj" with lore "&eKliknij, aby twoj pet stal || w miejscu" to close then run "sudo %player% pety stoj"
  58. format slot 8 of player with 1 of redstone block named "&6>> &c&lZamknij&6 <<" to close
  59.  
  60. command /pety [<text=gui>] [<text=entity type>] [<text>]:
  61. trigger:
  62. if arg 1 is "help":
  63. send "&e/pety gui"
  64. send "&e/pety setname [nazwa i zamiast spacji prosze dac _]"
  65. send "&e/pety jazda"
  66. send "&e/pety nazwij"
  67. send "&e/pety ruch"
  68. send "&e/pety stoj"
  69. if player have permissions "pety.*":
  70. send "&c/pety stworz [nazwa moba pisana z malej litery]"
  71. send "&c/pety setlore [opis i zamiast spacji prosze dac _]"
  72. if arg 1 is "gui":
  73. function "pety.gui" {player and "1"};
  74. if arg 1 is "stworz":
  75. if arg 2 is set:
  76. if player have permissions "pety.*":
  77. if arg 2 is set:
  78. set {_pety} to yaml value "pety.%arg 2%.create" from "pety/config.yml"
  79. if {_pety} is not set:
  80. set yaml value "pety.%arg 2%.create" from "pety/config.yml" to "true"
  81. set yaml value "pety.%arg 2%.lore" from "pety/config.yml" to "&eTo jest podstawowy opis || %arg 2% "
  82. send "&eDodales %arg 2% do listy petow!"
  83. else:
  84. send "&eIstnieje juz taki pet!"
  85. else:
  86. send "&eNie wpisales nazwy moba!"
  87. if arg 1 is "setlore":
  88. if arg 2 is set:
  89. if arg 3 is set:
  90. if player have permissions "pety.*":
  91. set {_pety} to yaml value "pety.%arg 2%.create" from "pety/config.yml"
  92. if {_pety} is not set:
  93. send "&eNie ma takiego peta!"
  94. else:
  95. set {_msg} to arg 3
  96. replace all "_" with " " in {_msg}
  97. replace all "&" with "ยง" in {_msg}
  98. set yaml value "pety.%arg 2%.lore" from "pety/config.yml" to "%{_msg}%"
  99. send "&eUstawiles opis %arg 2% na %{_msg}%"
  100. if arg 1 is "setname":
  101. if arg 2 is set:
  102. set {_nazwap} to yaml value "%player%.nazwapeta" from "pety/gracze.yml"
  103. loop all entities:
  104. if name of loop-entity is "%{_nazwap}%":
  105. kill loop-entity
  106. wait 1 second
  107. set {_nazwa} to arg 2
  108. replace all "_" with " " in {_nazwa}
  109. set {_nazwa} to colored {_nazwa}
  110. set yaml value "%player%.nazwapeta" from "pety/gracze.yml" to "%{_nazwa}%"
  111. send "&eNazwales peta %{_nazwa}%"
  112. if arg 1 is "jazda":
  113. loop all entities:
  114. if {pet::%loop-entity%} is set:
  115. set {_petname} to yaml value "%player%.nazwapeta" from "pety/gracze.yml"
  116. if name of loop-entity is {_petname}:
  117. set {_p} to location of player
  118. set {_locpet} to location of loop-entity
  119. if distance between {_locpet} and {_p} <= 6:
  120. make the player ride loop-entity
  121. while player's vehicle is loop-entity:
  122. push loop-entity in direction of player at speed 0.1
  123. if block in front of player is not air:
  124. push loop-entity upwards at speed 0.1
  125. wait 3 ticks
  126. wait 1 tick
  127. else:
  128. send "&eTwoj pet jest za dalego lub nie zostal przywolany"
  129. if arg 1 is "nazwij":
  130. set yaml value "%name of player%.nazywa" from "pety/gracze.yml" to "true"
  131. send "&eNapisz nazwe peta na czacie"
  132. if arg 1 is "ruch":
  133. set yaml value "%name of player%.ruch" from "pety/gracze.yml" to "true"
  134.  
  135. if arg 1 is "stoj":
  136. set yaml value "%name of player%.ruch" from "pety/gracze.yml" to "false"
  137.  
  138. on chat:
  139. set {_nazwa} to yaml value "%player%.nazywa" from "pety/gracze.yml"
  140. if {_nazwa} is "true":
  141. cancel event
  142. set {_nazwap} to yaml value "%player%.nazwapeta" from "pety/gracze.yml"
  143. loop all entities:
  144. if name of loop-entity is "%{_nazwap}%":
  145. kill loop-entity
  146. wait 1 second
  147. set {_nazwa} to message
  148. replace all "_" with " " in {_nazwa}
  149. set {_nazwa} to colored {_nazwa}
  150. set yaml value "%player%.nazwapeta" from "pety/gracze.yml" to "%{_nazwa}%"
  151. send "&eNazwales peta %{_nazwa}%"
  152. set yaml value "%name of player%.nazywa" from "pety/gracze.yml" to "false"
  153.  
  154. on damage:
  155. if {pet::%victim%} is set:
  156. cancel event
  157. if {pet::%attacker%} is set:
  158. cancel event
  159. on death:
  160. if {pet::%victim%} is set:
  161. clear drops
  162.  
  163. command /getpet [<player>] <entity type>:
  164. trigger:
  165. if arg 1 is set:
  166. if arg 2 is set:
  167. set {_pety} to yaml value "pety.%arg 2%.create" from "pety/config.yml"
  168. if {_pety} is not set:
  169. send "&eNie ma takiego peta!"
  170. else:
  171. loop all entities:
  172. if {pet::%loop-entity%} is set:
  173. set {_petname} to yaml value "%player-arg%.nazwapeta" from "pety/gracze.yml"
  174. if name of loop-entity is {_petname}:
  175. kill loop-entity
  176. set {_pet} to arg 2
  177. set {_pet} to {_pet} parsed as entity type
  178. spawn {_pet} at location of player-arg
  179. set {_nazwapeta} to yaml value "%player-arg%.nazwapeta" from "pety/gracze.yml"
  180. set {pet::%last spawned entity%} to player-arg
  181. set name of last spawned entity to "%{_nazwapeta}%"
  182.  
  183. every second:
  184. loop all entities:
  185. if {pet::%loop-entity%} is set:
  186. set {_name} to {pet::%loop-entity%}
  187. set {_online} to yaml value "%{_name}%.online" from "pety/gracze.yml"
  188. set {_ruch} to yaml value "%{_name}%.ruch" from "pety/gracze.yml"
  189. set {_name} to {_name} parsed as player
  190. set {_pet} to loop-entity
  191. set {_locpet} to location of loop-entity
  192. if {_online} is "true":
  193. if {_ruch} is "true":
  194. if distance between {_locpet} and {_name} >= 6:
  195. set {_loc} to location of {_name}
  196. teleport {_pet} to {_loc}
  197.  
  198. on any move:
  199. if {pet::%event-entity%} is set:
  200. set {_name} to {pet::%event-entity%}
  201. set {_ruch} to yaml value "%{_name}%.ruch" from "pety/gracze.yml"
  202. set {_ruch} to {_ruch} parsed as text
  203. if {_ruch} is false:
  204. cancel event
  205.  
  206. method "pety.gui" {gracz}:
  207. set {_g} to arg{1};
  208. set {_pety::*} to configuration section "pety" get of "plugins/Skript/scripts/pety/config.yml"
  209. set {_wys} to single value "wysokosctabeli" get of "plugins/Skript/scripts/pety/config.yml"
  210. set {_wysokosc} to {_wys} parsed as number
  211. wait tick
  212. open chest with {_wysokosc} rows named "&4&n&lPety" to {_g}
  213. wait 3 ticks
  214. loop {_pety::*}:
  215. add 1 to {_slot}
  216. set {_lore} to yaml value "pety.%loop-value%.lore" from "pety/config.yml"
  217. set {_pet} to loop-value
  218. set {_pet} to {_pet} parsed as entity type
  219. format slot {_slot}-1 of {_g} with 1 of bottle of enchanting named "&a&l%{_pet}%" with lore "%{_lore}%" to close then run "getpet %{_g}% %{_pet}% "
  220. format slot 22 of {_g} with 1 of redstone block named "&6>> &c&lPowrot&6 <<" to close
Advertisement
Add Comment
Please, Sign In to add comment