Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
4,359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. # Vote skript by dvwinn
  2. # Feel free to edit for personal use
  3.  
  4. options:
  5. prefix: &8&lVote >>&7
  6.  
  7. command /startvote <integer> <text>:
  8. description: Starts a vote for a specific amount of time
  9. usage: /startvote <time in seconds> <vote>
  10. permission: skript.vote.start
  11. trigger:
  12. if {vote::inVote} is true:
  13. message "{@prefix} There is already a vote in progress!" to command sender
  14. else:
  15. set {vote::inVote} to true
  16. set {vote::votes::y} to 0
  17. set {vote::votes::n} to 0
  18. broadcast "{@prefix} Vote started for %arg 2%"
  19. broadcast "{@prefix} Answer in chat by saying 'y' or 'n'"
  20. loop arg 1 times:
  21. wait 1 second
  22. broadcast "{@prefix} Vote ended! Yes had %{vote::votes::y}% results, and No had %{vote::votes::n}% results!"
  23. delete {vote::*}
  24.  
  25. on chat:
  26. if message is equal to "y":
  27. {vote::inVote} is true
  28. {vote::voted::%player%} is not set
  29. add 1 to {vote::votes::y}
  30. set {vote::voted::%player%} to true
  31. cancel the event
  32. message "{@prefix} Your vote has been counted" to the player
  33. else if message is equal to "n":
  34. {vote::inVote} is true
  35. {vote::voted::%player%} is not set
  36. add 1 to {vote::votes::n}
  37. set {vote::voted::%player%} to true
  38. cancel the event
  39. message "{@prefix} Your vote has been counted" to the player
  40. else:
  41. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement