Onenrico

Emerald Shop V1

Apr 4th, 2016
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. #Copyright By Enrico , Jangan Sampai Di Claim !
  2.  
  3. #Cara Penggunaaan
  4. #Pertama Pegang item yang ingin dijual
  5. #Lalu Tulis /es <namaNPC> <Harga> <SlotItem> <Lore> #Gunakan || untuk lore baris ganda :V
  6. #Buat Npc yang telah di set namanya tadi
  7.  
  8. options:
  9. pr: emeraldshop
  10. pf: &8&l(&6-&8> &fEShop&8>&a
  11. item: emerald
  12.  
  13. on inventory close:
  14. delete {shopmode.%player%}
  15. loop items in player's inventory:
  16. lore of loop-item contains "Price:":
  17. remove loop-item from player #anti BUG
  18.  
  19. on npc right click:
  20. wait 2 tick
  21. loop {{@pr}::*}:
  22. if citizen name is "%loop-value%":
  23. set {shopmode.%player%} to true
  24. wait 2 tick
  25. open chest with 6 row named "%loop-value% Shop" to player
  26. loop 54 times:
  27. set {_a} to loop-num - 1
  28. if {{@pr}.%{_a}%::item%loop-value%} is set:
  29. if {{@pr}.%{_a}%::lore%loop-value%} is set:
  30. format slot {_a} of player with {{@pr}.%{_a}%::item%loop-value%} named "%{{@pr}.%{_a}%::name%loop-value%}%" with lore "%{{@pr}.%{_a}%::lore%loop-value%}%||&fPrice: &a%{{@pr}.%{_a}%::price%loop-value%}% &fEmerald" to close then run "sudo %player% checkershop %{{@pr}.%{_a}%::name%loop-value%}% %{{@pr}.%{_a}%::price%loop-value%}%"
  31. if {{@pr}.%{_a}%::lore%loop-value%} is not set:
  32. format slot {_a} of player with {{@pr}.%{_a}%::item%loop-value%} named "%{{@pr}.%{_a}%::name%loop-value%}%" with lore "&fPrice: &a%{{@pr}.%{_a}%::price%loop-value%}% &fEmerald" to close then run "sudo %player% checkershop %{{@pr}.%{_a}%::item%loop-value%}% %{{@pr}.%{_a}%::price%loop-value%}%"
  33. wait 1 tick
  34.  
  35. command /emeraldshop [<text>] [<number>] [<number>] [<text>]:
  36. usage: /emeraldshop <NamaNPC> <Harga> <Slot> <Lore>
  37. aliases: es
  38. trigger:
  39. if player don't have permission "{@pr}":
  40. stop
  41. if arg 1 is not set:
  42. send "{@pf} /emeraldshop <NamaNPC> <Harga> <Slot> <Lore>"
  43. stop
  44. if arg 1 is set:
  45. if arg 2 is not set:
  46. send "{@pf} /emeraldshop <NamaNPC> <Harga> <Slot> <Lore>"
  47. stop
  48. if arg 2 is set:
  49. if arg 3 is not set:
  50. send "{@pf} /emeraldshop <NamaNPC> <Harga> <Slot> <Lore>"
  51. stop
  52. if arg 3 is set:
  53. if arg 4 is not set:
  54. send "{@pf} /emeraldshop <NamaNPC> <Harga> <Slot> <Lore>"
  55. stop
  56. if arg 4 is set:
  57. set {{@pr}.%arg 3%::name%arg 1%} to player's tool
  58. if name of player's tool is set:
  59. set {{@pr}.%arg 3%::name%arg 1%} to name of player's tool
  60. set {{@pr}.%arg 3%::item%arg 1%} to player's tool
  61. set {{@pr}.%arg 3%::price%arg 1%} to arg 2
  62. set {{@pr}.%arg 3%::lore%arg 1%} to "%arg 4%"
  63. if lore of player's tool is set:
  64. set {{@pr}.%arg 3%::lore%arg 1%} to "%lore of player's tool%||%arg 4%"
  65. add arg 1 to {{@pr}::*}
  66. send "{@pf} Item &6%player's tool% &ftelah berhasil di set di NPC &a%arg 1%&f, pada slot &a%arg 3%&f, dengan harga &a%arg 2%&f, dan Lore %arg 4%"
  67.  
  68. command /checkershop [<text>] [<number>]:
  69. trigger:
  70. if {shopmode.%player%} is true:
  71. set {_count} to number of emerald in player's inventory
  72. set {_c} to arg 2
  73. if {_count} is more than or equal to {_c}:
  74. set {_i} to arg 1 parsed as item
  75. give player {_i}
  76. loop {_c} times:
  77. remove 1 emerald from player
  78. send "{@pf} Kamu berhasil membeli %{_i}% , dengan harga %arg 2% emerald"
  79. stop
  80. send "{@pf} Maaf Emerald Mu kurang untuk membeli ini"
Advertisement
Add Comment
Please, Sign In to add comment