ArtzifyHD

StaffChat Skript

Jul 14th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. on script load:
  2. if "plugins/StaffChat/config.yml" does not exist:
  3. delete {config::*}
  4. create file "plugins/StaffChat/config.yml"
  5. if {config::zprefix} is not set:
  6. set yaml value "prefix" from file "../../StaffChat/config.yml" to "&7[&3StaffChat&7]"
  7. if {config::layout} is not set:
  8. set yaml value "layout" from file "../../StaffChat/config.yml" to "{prefix} &3{player}&7:"
  9. if {config::pmessage} is not set:
  10. set yaml value "permission message" from file "../../StaffChat/config.yml" to "&cNo Permission!"
  11. if {config::permission} is not set:
  12. set yaml value "permission" from file "../../StaffChat/config.yml" to "staffchat.use"
  13. set {config::permission} to yaml value "permission" from file "../../StaffChat/config.yml"
  14. set {config::layout} to yaml value "layout" from file "../../StaffChat/config.yml"
  15. set {config::zprefix} to yaml value "prefix" from file "../../StaffChat/config.yml"
  16. set {config::pmessage} to yaml value "permission message" from file "../../StaffChat/config.yml"
  17. replace all "&" with "§" in {config::zprefix}
  18. replace all "Â" with "" in {config::zprefix}
  19. replace all "\xa7" with "&" in {config::zprefix}
  20. replace all "\xbb" with "»" in {config::zprefix}
  21. replace all "&" with "§" in {config::layout}
  22. replace all "Â" with "" in {config::layout}
  23. replace all "&" with "§" in {config::pmessage}
  24. replace all "Â" with "" in {config::pmessage}
  25. replace all "{permission}" with "%{config::permission}%" in {config::pmessage}
  26.  
  27.  
  28. command /sc:
  29. aliases: /staffchat
  30. trigger:
  31. if player does not have permission "%{config::permission}%":
  32. message "%{config::pmessage}%"
  33. stop
  34. else:
  35. if {sc.%player%} is not set:
  36. message "%{config::zprefix}% &7Your staff chat has been toggled &a&lON&7!"
  37. set {sc.%player%} to true
  38. stop
  39. else:
  40. message "%{config::zprefix}% &7Your staff chat has been toggled &c&lOFF&7!"
  41. delete {sc.%player%}
  42. stop
  43.  
  44.  
  45. on chat:
  46. if {sc.%player%} is set:
  47. if player has permission "staffchat.use":
  48. cancel event
  49. loop all players:
  50. if loop-player has permission "staffchat.use":
  51. replace all "{prefix}" with "%{config::zprefix}%" in {config::layout}
  52. replace all "{player}" with "%player%" in {config::layout}
  53. message "%{config::layout}% %the message%" to loop-player
  54. stop
  55. else:
  56. delete {sc.%player%}
  57. stop
Add Comment
Please, Sign In to add comment