Advertisement
Phe0X

Skript de Shop

Feb 17th, 2017
2,076
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. #A UTILISER AVEC UN SKRIPT DE COINS (https://www.youtube.com/watch?v=-atvmv7dA58)
  2.  
  3. on rightclick on sign:
  4. if line 1 of clicked block is "[Shop]":
  5. if line 2 of clicked block is "Buy":
  6. set {_price} to line 3 of clicked block
  7. set {_item} to line 4 of clicked block
  8. if {_price} parsed as a number > {coins.%player's UUID%}:
  9. send "&c[Shop] Vous n'avez pas assez d'argent pour acheter %{_item}%"
  10. stop
  11.  
  12. else:
  13. remove {_price} parsed as a number from {coins.%player's UUID%}
  14. give player {_item} parsed as item
  15. send "&a[Shop] Vous avez bien acheté %{_item}% pour %{_price}%$ ! Il vous reste %{coins.%player's UUID%}% coins !"
  16. if line 2 of clicked block is "Sell":
  17. set {_price} to line 3 of clicked block
  18. set {_item} to line 4 of clicked block
  19. if player is holding {_item} parsed as a item:
  20. remove {_item} parsed as an item from player's inventory
  21. add {_price} parsed as a number to {coins.%player's UUID%}
  22. send "&a[Shop] Vous avez bien vendu %{_item}% pour %{_price}%$ ! Vous avez %{coins.%player's UUID%}% coins !"
  23. stop
  24.  
  25. else:
  26. send "&c[Shop] Vous ne tenez pas %{_item}% dans la main !"
  27. on sign change:
  28. if line 1 is "[Shop]":
  29. if player don't have permission "shop.create":
  30. send "&c[Shop] Tu n'a pas la permission de créer un shop !"
  31. cancel event
  32. stop
  33. if player has permission "shop.create":
  34. if line 2 is "Buy":
  35. set {_line3} to line 3
  36. if {_line3} parsed as a number is a number:
  37. set {_line4} to line 4
  38. if {_line4} parsed as an item is an item:
  39. send "&a[Shop] Shop créé pour l'item %line 4% !"
  40. stop
  41. else:
  42. send "&c[Shop] Mauvaise syntaxe (1:[Shop] 2:Buy/Sell 3:Prix 4:ITEM "
  43. cancel event
  44. stop
  45. else:
  46. send "&c[Shop] Mauvaise syntaxe (1:[Shop] 2:Buy/Sell 3:Prix 4:ITEM "
  47. cancel event
  48. stop
  49. if line 2 is "Sell":
  50. set {_line3} to line 3
  51. if {_line3} parsed as a number is a number:
  52. set {_line4} to line 4
  53. if {_line4} parsed as an item is an item:
  54. send "&a[Shop] Shop créé pour l'item %line 4% !"
  55. stop
  56. else:
  57. send "&c[Shop] Mauvaise syntaxe (1:[Shop] 2:Buy/Sell 3:Prix 4:ITEM "
  58. cancel event
  59. stop
  60. else:
  61. send "&c[Shop] Mauvaise syntaxe (1:[Shop] 2:Buy/Sell 3:Prix 4:ITEM "
  62. cancel event
  63. stop
  64. else:
  65. send "&c[Shop] Mauvaise syntaxe (1:[Shop] 2:Buy/Sell 3:Prix 4:ITEM "
  66. stop
  67.  
  68. on break:
  69. if event-block is a sign:
  70. if player don't have permission "shop.create":
  71. if line 1 of event-block is "[Shop]":
  72. cancel event
  73. on explode:
  74. loop exploded blocks:
  75. if loop-block is a sign:
  76. if line 1 of loop-block is "[Shop]":
  77. cancel event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement