NAOSAMA

Untitled

Mar 16th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. #
  2. # ChatGame by Andalmere | Please leave a 5-star review ;)
  3. #
  4.  
  5. # Here you can configure everything you want, from prefixes to modes.
  6. options:
  7.  
  8. # -=[]=-
  9. # Settings
  10. # -=[]=-
  11.  
  12. # Prefixes will be displayed in each broadcast.
  13. prefix: &8[&2C&ah&6a&ct &4G&ea&3m&be&8]
  14.  
  15. # Minimum players in order to start the chat game.
  16. min-players: 5
  17.  
  18. # Delay between each game/broadcast.
  19. delay: 600
  20.  
  21. # How many random characters to be guessed?
  22. chars: 8
  23.  
  24. # Do we need to hide the answer of the player who guessed the answer?
  25. hide-word-on-chat: true
  26.  
  27. # Enable reward when a player guessed the answer?
  28. enable-reward: true
  29.  
  30. # If enable-reward is enabled, this command will be executed.
  31. reward-command: eco give %player% 100
  32.  
  33. # This would be displayed if a new chatgame starts.
  34. broadcast-pending: &6Type this to win » &e%{word}%&6!
  35.  
  36. # This would be displayed if someone guessed the answer.
  37. broadcast-win: &e%player% &6won the game!
  38.  
  39. # How many seconds do we need to wait to consider that no one answered the chatgame.
  40. warm-seconds: 60
  41.  
  42. # This would be displayed if no one answered the chatgame.
  43. broadcast-none: &cNo one answered the chatgame.
  44.  
  45. # ---------------------------------------------= [ Code ] =-----------------------------------------------------------
  46.  
  47. on join:
  48. add 1 to {chatgame.players::*}
  49.  
  50. on quit:
  51. reduce {chatgame.players::*} by 1
  52.  
  53. every {@delay} seconds:
  54. {chatgame.players::*} >= {@min-players}
  55. set {chatgame.chat} to true
  56. set {word} to random {@chars} char string from `a-zA-Z0-9`
  57. broadcast "{@prefix} {@broadcast-pending}"
  58. set {chatgame.active} to now
  59. stop
  60.  
  61. on chat:
  62. if {chatgame.chat} is true:
  63. if message contains "%{word}%":
  64. set {chatgame.chat} to false
  65. delete {chatgame.active}
  66. if {@hide-word-on-chat} is true:
  67. cancel event
  68. if {@enable-reward} is true:
  69. execute console command "{@reward-command}"
  70. broadcast "{@prefix} {@broadcast-win}"
  71. stop
  72.  
  73. every tick:
  74. if {chatgame.active} is set:
  75. if difference between {chatgame.active} and now is greater than {@warm-seconds} seconds:
  76. set {chatgame.chat} to false
  77. delete {chatgame.active}
  78. broadcast "{@prefix} {@broadcast-none}"
  79. stop
  80. # --------------------------------------------= [ End of Code ] =-----------------------------------------------------
Add Comment
Please, Sign In to add comment