Onenrico

Class Tool

Sep 10th, 2016
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. on skript load:
  2. delete {class::*}
  3. delete {classtool::*}
  4. delete {antitool::*}
  5. add "wizard" to {class::*}
  6. add "stick" to {classtool.wizard::*}
  7. add "sword" to {antitool.wizard::*}
  8. add "hoe" to {antitool.wizard::*}
  9. add "shovel" to {antitool.wizard::*}
  10. add "bow" to {antitool.wizard::*}
  11. add "axe" to {antitool.wizard::*}
  12. add "pickaxe" to {antitool.wizard::*}
  13. function chand(p: text, class: text) :: text:
  14. loop {class::*}:
  15. if "%loop-value%" is "%{_class}%":
  16. set {_p} to {_p} parsed as player
  17. set {_a} to {_p}'s tool
  18. loop {classtool.%{_class}%::*}:
  19. if "%type of {_a}%" contains "%loop-value%":
  20. return "true"
  21. stop
  22. loop {antitool.%{_class}%::*}:
  23. if "%type of {_a}%" contains "%loop-value%":
  24. return "false"
  25. stop
  26. return "true"
  27. on rightclick:
  28. set {_f} to chand("%player%", "%{class.%player%}%")
  29. if "%{_f}%" is "false":
  30. cancel event
  31. send "&8[&bClass&8]&b You Can't Use This Tool"
  32. send "&8[&bClass&8]&b Because Your Class Is A &6%{class.%player%}%"
  33. PLAY "ENTITY_VILLAGER_NO" to player with volume 1
  34. stop
  35. on leftclick:
  36. set {_f} to chand("%player%", "%{class.%player%}%")
  37. if "%{_f}%" is "false":
  38. cancel event
  39. send "&8[&bClass&8]&b You Can't Use This Tool"
  40. send "&8[&bClass&8]&b Because Your Class Is A &6%{class.%player%}%"
  41. PLAY "ENTITY_VILLAGER_NO" to player with volume 1
  42. stop
  43.  
  44. command /class [<text>]:
  45. trigger:
  46. loop {class::*}:
  47. if arg 1 is "%loop-value%":
  48. send "&8[&bClass&8]&e Your Class set to %loop-value%"
  49. set {class.%player%} to loop-value
  50. stop
  51. add loop-value to {_list::*}
  52. send "&8&m-----&6 Class List &8&m-----"
  53. loop {_list::*}:
  54. send "&3&l> &6%loop-value%"
  55. send "&8[&bClass&8]&c No Class Named %arg 1%"
Advertisement
Add Comment
Please, Sign In to add comment