Advertisement
Guest User

Vote skript

a guest
Apr 25th, 2014
1,228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. # Vote skript by dvwinn
  2. # Feel free to edit for personal use
  3.  
  4. options:
  5. prefix : &7[&3Vote&7]&b
  6.  
  7. variables:
  8. {invote} = false
  9. {votes.y} = 0
  10. {votes.n} = 0
  11.  
  12. command /startvote <text>:
  13. description: Starts a vote
  14. usage: /startvote <vote>
  15. permission: skript.vote.start
  16. permission message: You don't have permission to use this command
  17. executable by: players and console
  18. trigger:
  19. if {invote} is true:
  20. message "{@prefix} There is already a vote in progress!" to command sender
  21. else:
  22. set {invote} to true
  23. set {votes.y} to 0
  24. set {votes.n} to 0
  25. loop all players:
  26. set {voted.%loop-player%} to false
  27. broadcast "{@prefix} Vote started for %arg 1%"
  28. broadcast "{@prefix} Answer in chat by saying 'y' or 'n'"
  29.  
  30. command /endvote:
  31. description: Ends a vote
  32. usage: /endvote
  33. permission: skript.vote.end
  34. permission message: You don't have permission to use this command
  35. executable by: players and console
  36. trigger:
  37. {invote} is true
  38. set {invote} to false
  39. broadcast "{@prefix} Vote ended! Yes had %{votes.y}% results, and No had %{votes.n}% results!"
  40.  
  41. on chat:
  42. if message is equal to "y":
  43. {invote} is true
  44. {voted.%player%} is false
  45. add 1 to {votes.y}
  46. set {voted.%player%} to true
  47. cancel the event
  48. message "{@prefix} Your vote has been counted" to the player
  49. else if message is equal to "n":
  50. {invote} is true
  51. {voted.%player%} is false
  52. add 1 to {votes.n}
  53. set {voted.%player%} to true
  54. cancel the event
  55. message "{@prefix} Your vote has been counted" to the player
  56. else:
  57. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement