1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Voting Skript

Discussion in 'Skript' started by Ali Tuna BAYLAN, Jun 5, 2022.

Thread Status:
Not open for further replies.
  1. Ali Tuna BAYLAN

    Joined:
    Jun 5, 2022
    Messages:
    4
    Likes Received:
    0
    Usage: /votestart [option1] [option2] [time]

    Code (Text):
    1. command /votestart <text> <text> <number = 20>:
    2.     permission: op
    3.     trigger:
    4.         set {vote1} to arg-1
    5.         set {vote2} to arg-2
    6.         set {opt1} to 0
    7.         set {opt2} to 0
    8.         open chest with 1 rows named "&bVote" to all players
    9.         format slot 3 of player with iron ingot named arg-1 with lore "&cC&4l&6i&ec&2k &at&bo &3V&1o&dt&5e&f!" to close then run [execute player command "/vote %player% %{vote1}%"]
    10.         format slot 5 of player with gold ingot named arg-2 with lore "&cC&4l&6i&ec&2k &at&bo &3V&1o&dt&5e&f!" to close then run [execute player command "/vote %player% %{vote2}%"]
    11.         broadcast "&bVoting Start..."
    12.         wait "%arg-3% seconds" parsed as timespan
    13.         broadcast "&bVoting End!"
    14.         set {total} to {opt1} + {opt2}
    15.         broadcast "&f%{vote1}%: &a%{opt1}%%newline%&f%{vote2}%: &a%{opt2}%%newline%&fTotal: &b%{total}%"
    16. command /vote <text> <text>:
    17.     trigger:
    18.         if arg-2 is {vote1}:
    19.             broadcast "&a%arg-1% &fvoted for &b%arg-2%&f!"
    20.             add 1 to {opt1}
    21.         if arg-2 is {vote2}:
    22.             broadcast "&a%arg-1% &fvoted for &b%arg-2%&f!"
    23.             add 1 to {opt2}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...