Advertisement
Guest User

LuckyChest Skript

a guest
May 22nd, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.05 KB | None | 0 0
  1. #+--------------------------------------------------+
  2. # Skript Name: Lucky Chest
  3. # Version: V1.0
  4. # Author: Yusril Takeuchi
  5. #
  6. # Skript ini adalah Lucky Chest yang berarti
  7. # Chest keberuntungan. Fungsinya jika kita menemukan chest ini
  8. # maka kita akan mendapatkan sebuah item didalamnya.
  9. # Tapi jika ingin membukanya perlu memerlukan sebuah Key.
  10. # Bagi admin, mendapatkan Key bisa dengan cara /lc get key.
  11. # Namun untuk member, kalian para staff bisa mengkreatifitaskan sendiri.
  12. # Bagi donatur, kalian bisa mendapatkan 2x loot dari dalam chest.
  13. # Dan perlu memerlukan permission luckychest.donatur
  14. #
  15. # Permission:
  16. # luckychest.open - Berguna untuk bisa membuka Lucky Chest
  17. # luckychest.key - Berguna untuk mendapatkan Key dengan command /lc get key
  18. # luckychest.donatur - Mendapatkan 2x jumlah barang dari dalam chest. Recommended untuk donatur.
  19. # luckychest.reload - Akses menggunakan /lc reload untuk mengreload skript ini.
  20. # luckychest.help - Mengakses seluruh command
  21. #
  22. # Features:
  23. # - Loot Chest System
  24. # - Double Donatur Loot
  25. # - Key System
  26. # - Reload Command
  27. # - Hook System
  28. #
  29. # Requirements:
  30. # - ExtrasSK
  31. #
  32. # Cara Install:
  33. # 1.Masukan file ini di directory .../plugins/skript/script/
  34. # 2.Reload dengan menggunakan command /skript reload LuckyChest
  35. # 3.Gunakan command /lc atau /luckychest untuk mengakses seluruh command
  36. #
  37. # Command:
  38. # - /lc
  39. # - /lc get key
  40. # - /lc reload
  41. # - /lc help
  42. #
  43. # Changelog Version:
  44. # V1.0:
  45. # - Release Skript
  46. #
  47. #+-------------------------------------------------------------------------------------------------------------+
  48. # =Author Note=
  49. # Jika anda ingin mengedit skript ini silahkan, tapi SAYA TIDAK BERTANGGUNG JAWAB atas
  50. # kerusakan yang anda perbuat sendiri, disarankan bertanya sebelum ingin mengeditnya.
  51. # Dan selalu membaca deskripsi / penjelasan dari tiap line agar mengetahui fungsi fungsinya
  52. #
  53. # =BIG WARNING=
  54. # Mengganti Author resmi berarti melanggar Hak Cipta
  55. # © Copyright 2015 Yusril Takeuchi
  56. #
  57. #+-------------------------------------------------------------------------------------------------------------+
  58. #
  59. #+-------------------------------------------------------------------------------------------------------------+
  60. #
  61. # =Extra Note=
  62. # Kamu Membutuhkan Plugin Skript Tambahan Agar Skript Berjalan Lancar Atau Akan Terjadi Error
  63. # Skript Addon Required: ExtrasSK
  64. # http://dev.bukkit.org/bukkit-plugins/skript/forum/misc/66835-addon-extras-sk-1-5-added-crop-grow-trample-events/
  65. #
  66. #+-------------------------------------------------------------------------------------------------------------+
  67.  
  68. #+-----------------------------------+
  69. #
  70. # OPTIONS
  71. #
  72. #+-----------------------------------+
  73.  
  74. options:
  75. # --- Title And Prefix --- #
  76. Title: &b&lLucky Chest
  77. Prefix: &7[&bLucky Chest&7] &b
  78.  
  79. # --- Permission --- #
  80. PermOpen: luckychest.open
  81. PermKey: luckychest.key
  82. PermDonatur: luckychest.donatur
  83. PermReload: luckychest.reload
  84. PermHelp: luckychest.help
  85.  
  86. # --- Double Loot Donatur --- #
  87. LootDouble: 2
  88.  
  89. # --- Type key --- #
  90. Key: tripwire hook
  91. KeyName: &6[&3Lucky Key&6]
  92.  
  93. # --- Loot --- #
  94. Loot: Iron ingot
  95. Loot2: Gold ingot
  96. Loot3: Diamond
  97. Loot4: Iron Sword
  98. Loot5: Gold Sword
  99. Loot6: Diamond Sword
  100.  
  101. # --- Jumlah Loot Donatur--- #
  102. LootJumlahD: 2
  103. LootJumlahD2: 2
  104. LootJumlahD3: 2
  105. LootJumlahD4: 2
  106. LootJumlahD5: 2
  107. LootJumlahD6: 2
  108.  
  109. # --- Jumlah Loot Player --- #
  110. LootJumlah: 1
  111. LootJumlah2: 1
  112. LootJumlah3: 1
  113. LootJumlah4: 1
  114. LootJumlah5: 2
  115. LootJumlah6: 2
  116.  
  117. # --- Skript File Name --- #
  118. LuckyChest: LuckyChest
  119.  
  120. # --- Addon --- #
  121. ExtrasSk: ExtrasSK.jar
  122.  
  123. # --- About --- #
  124. Author: &dYusrilTakeuchi
  125. Version: &dV1.0
  126.  
  127. # --- Lore Key --- #
  128. LoreKey: &c&l•&bBisa Digunakan Untuk Membuka Lucky Chest||&c&l•&bKlik Kanan Ke Arah Ender Chest Untuk Mendapatkan Loot||&c&l•&4Tidak Berlaku Untuk Chest Biasa||&c&l•&4Loot Bisa Berupa Material, Makanan, Atau Senjata|| ||&c&l•&3Klik Kanan Ke Chest Untuk Menggunakan
  129.  
  130.  
  131. #+-----------------------------------+
  132. #
  133. # ON JOIN
  134. #
  135. #+-----------------------------------+
  136.  
  137.  
  138. # --- Bagian ini untuk set double 2x loot. tapi berhubung saya tidak pakai ini jadi dibiarkan saja --- #
  139. # --- Jika anda ingin menggunakannya silahkan --- #
  140. on join:
  141.  
  142. # --- Ketika player memiliki permission donatur --- #
  143. player has permission "{@PermDonatur}":
  144.  
  145. # --- Mengset variable ke options
  146. set {lc.loot} to {@LootDouble}
  147. else:
  148. stop
  149.  
  150. on join:
  151. wait 50 ticks
  152. message "&b//&b&m----------&7[ {@Title} &7]&b&m----------&b\\"
  153. message " &3Name&7: &b{@LuckyChest}"
  154. message " &3Author&7: {@Author}"
  155. message " &3Version&7: {@Version}"
  156. message " "
  157. message " &c&l•&bThis server powered by {@LuckyChest}"
  158. message "&b//&b&m----------&7[ {@Title} &7]&b&m----------&b\\"
  159.  
  160.  
  161. #+-----------------------------------+
  162. #
  163. # RIGHTCLICK ENDER CHEST
  164. #
  165. #+-----------------------------------+
  166.  
  167.  
  168. # --- Ketika player klik kanan ke ender chest --- #
  169. on rightclick on ender chest:
  170.  
  171. # --- Jika player memegang sebuah Lucky Key --- #
  172. player is holding {@Key}:
  173.  
  174. # --- Nama Key sesuai yang sudah di tentukan --- #
  175. "%name of player's held item%" is "{@KeyName}":
  176.  
  177. # --- Jika player memiliki permission membuka --- #
  178. player has permission "{@PermOpen}":
  179. player has permission "{@PermDonatur}":
  180.  
  181. # --- Chance of 80% ini untuk persentase pendapatan --- #
  182. chance of 80%:
  183.  
  184. # --- Dengan ada ini, chest tidak terbuka --- #
  185. cancel event
  186.  
  187. # --- SFX --- #
  188. play "LEVEL_UP" only to player with pitch 1 and volume 1
  189.  
  190. # --- Menghapus Lucky Key dari inventory --- #
  191. remove 1 tripwire hook named "{@KeyName}" with lore "{@LoreKey}" from player's inventory
  192.  
  193. # --- Menggive Loot Item ke player --- #
  194. give {@LootJumlahD} {@Loot} to player
  195. give {@LootJumlahD2} {@Loot2} to player
  196. message "{@Prefix}Mendapatkan &3{@LootJumlahD} {@Loot}, {@LootJumlahD2} {@Loot2}"
  197. chance of 50%:
  198. give {@LootJumlahD3} {@Loot3} to player
  199. message "{@Prefix}dan &3{@LootJumlahD3} {@Loot3}!"
  200. chance of 50%:
  201. cancel event
  202. play "LEVEL_UP" only to player with pitch 1 and volume 1
  203. remove 1 tripwire hook named "{@KeyName}" with lore "{@LoreKey}" from player's inventory
  204. give {@LootJumlahD4} {@Loot4} to player
  205. give {@LootJumlahD5} {@Loot5} to player
  206. message "{@Prefix}Mendapatkan &3{@LootJumlahD4} {@Loot4}, {@LootJumlahD5} {@Loot5}"
  207. chance of 50%:
  208. give {@LootJumlahD6} {@Loot6} to player
  209. message "{@Prefix}dan &3{@LootJumlahD6} {@Loot6}!"
  210.  
  211. else:
  212. chance of 80%:
  213. cancel event
  214. play "LEVEL_UP" only to player with pitch 1 and volume 1
  215. remove 1 tripwire hook named "{@KeyName}" with lore "{@LoreKey}" from player's inventory
  216. give {@LootJumlah} {@Loot} to player
  217. give {@LootJumlah2} {@Loot2} to player
  218. message "{@Prefix}Mendapatkan &3{@LootJumlahD} {@Loot}, {@LootJumlahD2} {@Loot2}"
  219. chance of 50%:
  220. give {@LootJumlahD3} {@Loot3} to player
  221. message "{@Prefix}dan &3{@LootJumlahD3} {@Loot3}!"
  222. chance of 50%:
  223. cancel event
  224. play "LEVEL_UP" only to player with pitch 1 and volume 1
  225. remove 1 tripwire hook named "{@KeyName}" with lore "{@LoreKey}" from player's inventory
  226. give {@LootJumlah4} {@Loot4} to player
  227. give {@LootJumlah5} {@Loot5} to player
  228. chance of 50%:
  229. give {@LootJumlah6} {@Loot6} to player
  230. message "{@Prefix}Mendapatkan &3{@LootJumlah4} {@Loot4}, {@LootJumlah5} {@Loot5} &bdan &3{@LootJumlah6} {@Loot6}!"
  231.  
  232. # --- Jika player tidak punya permission untuk membuka Lucky Chest --- #
  233. else:
  234. cancel event
  235. play "NOTE_BASS" only to player with pitch 0.5 volume 1
  236. message "{@Prefix}&4Maaf kamu tidak punya izin untuk membuka Lucky Chest!"
  237.  
  238. # --- Jika player tidak memiliki Lucky Key --- #
  239. else:
  240. play "NOTE_BASS" only to player with pitch 0.5 volume 1
  241. message "{@Prefix}Kamu tidak memiliki {@KeyName}!"
  242. cancel event
  243.  
  244. #+-----------------------------------+
  245. #
  246. # LUCKY CHEST COMMAND
  247. #
  248. #+-----------------------------------+
  249.  
  250. command /luckychest [<text>] [<text>]:
  251. aliases: /lc
  252. trigger:
  253. if arg 1 is not set:
  254. player has permission "{@PermHelp}":
  255. message "&6//&6&m----------&7[ {@Title} &7]&6&m----------&6\\"
  256. message " &6/lc help &7- &bMelihat seluruh command Sword Skill"
  257. message " &6/lc get key &7- &bMendapatkan Lucky Key"
  258. message " &6/lc reload &7- &bReload skript"
  259. message " &3Author&7: {@Author}"
  260. message " &3Version&7: {@Version}"
  261. message "&6//&6&m----------&7[ {@Title} &7]&6&m----------&6\\"
  262. else:
  263. message "{@Prefix}&4Maaf kamu tidak punya izin!"
  264. if arg 1 is "help":
  265. player has permission "{@PermHelp}":
  266. message "&6//&6&m----------&7[ {@Title} &7]&6&m----------&6\\"
  267. message " &6/lc help &7- &bMelihat seluruh command Sword Skill"
  268. message " &6/lc get key &7- &bMendapatkan Lucky Key"
  269. message " &6/lc reload &7- &bReload skript"
  270. message " &3Author&7: {@Author}"
  271. message " &3Version&7: {@Version}"
  272. message "&6//&6&m----------&7[ {@Title} &7]&6&m----------&6\\"
  273. else:
  274. message "{@Prefix}&4Maaf kamu tidak punya izin!"
  275. if arg 1 is "get":
  276. if arg 2 is "Key":
  277. player has permission "{@PermKey}":
  278. play "LEVEL_UP" only to player with pitch 1 and volume 1
  279. give 1 {@Key} named "{@KeyName}" with lore "{@LoreKey}" to player
  280. message "{@Prefix}Mendapatkan 1 {@KeyName}!"
  281. else:
  282. message "{@Prefix}&4Maaf kamu tidak punya izin!"
  283. if arg 1 is "reload":
  284. player has permission "{@PermReload}":
  285. play "NOTE_BASS" only to player with pitch 0.5 volume 1
  286. message "{@Prefix}Persiapan untuk reload skript!"
  287. wait 20 ticks
  288. play "NOTE_BASS" only to player with pitch 0.5 volume 1
  289. message "{@Prefix}1"
  290. wait 20 ticks
  291. play "NOTE_BASS" only to player with pitch 0.5 volume 1
  292. message "{@Prefix}2"
  293. wait 20 ticks
  294. play "NOTE_BASS" only to player with pitch 0.5 volume 1
  295. message "{@Prefix}3"
  296. wait 20 ticks
  297. execute console command "/sk reload {@LuckyChest}"
  298. play "LEVEL_UP" only to player with pitch 1 and volume 1
  299. message "{@Prefix}Berhasil reload Lucky Chest!"
  300. else:
  301. message "{@Prefix}&4Maaf kamu tidak punya izin!"
  302.  
  303. #+-----------------------------------+
  304. #
  305. # HOOK AND NOTIFICATION
  306. #
  307. #+-----------------------------------+
  308.  
  309. # --- Membutuhkan Extras Sk --- #
  310. on load:
  311. if file "plugins\{@ExtrasSk}" exists:
  312. message "{@Prefix}ExtrasSK Berhasil dihook! Let's Play The Sound!!" to the console
  313. stop
  314. else:
  315. message "{@Prefix}ExtrasSK Tidak terdeteksi, Akan segera di disable" to the console
  316. execute console command "/sk disable {@LuckyChest}"
  317. stop
  318.  
  319. # --- Sukses Load --- #
  320. on load:
  321. message "{@Prefix}{@LuckyChest} Berhasil Di Load! {@Version}" to the console
  322.  
  323. on unload:
  324. message "{@Prefix}{@LuckyChest} Berhasil Di Unload! {@Version}" to the console
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement