Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Vote skript by dvwinn
- # Feel free to edit for personal use
- options:
- prefix: &8&lVote >>&7
- command /startvote <integer> <text>:
- description: Starts a vote for a specific amount of time
- usage: /startvote <time in seconds> <vote>
- permission: skript.vote.start
- trigger:
- if {vote::inVote} is true:
- message "{@prefix} There is already a vote in progress!" to command sender
- else:
- set {vote::inVote} to true
- set {vote::votes::y} to 0
- set {vote::votes::n} to 0
- broadcast "{@prefix} Vote started for %arg 2%"
- broadcast "{@prefix} Answer in chat by saying 'y' or 'n'"
- loop arg 1 times:
- wait 1 second
- broadcast "{@prefix} Vote ended! Yes had %{vote::votes::y}% results, and No had %{vote::votes::n}% results!"
- delete {vote::*}
- on chat:
- if message is equal to "y":
- {vote::inVote} is true
- {vote::voted::%player%} is not set
- add 1 to {vote::votes::y}
- set {vote::voted::%player%} to true
- cancel the event
- message "{@prefix} Your vote has been counted" to the player
- else if message is equal to "n":
- {vote::inVote} is true
- {vote::voted::%player%} is not set
- add 1 to {vote::votes::n}
- set {vote::voted::%player%} to true
- cancel the event
- message "{@prefix} Your vote has been counted" to the player
- else:
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement