Advertisement
CARAB4O

Untitled

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