Sueta

Vote Day Skript

1.0

A skript which allows the users on the server to vote for it to become daytime in a world.

·Script

Vote Day is a simple skript allowing the users of your server to Vote for it to become daytime in a specific world. It requires 50% of the users on the server to run the command /voteday.

If 50% of the users run the command the world will change to daytime.

Skript
options:
    _world: world
variables:
    {Votes} = 0
    {canVote.%player%} = true
command /voteday:
    description: Vote for it to become day
    executable by: players
    trigger:
        if {canVote.%player%} is true:
            if {Votes} = 0:
                add 1 to {Votes}
                set {canVote.%player%} to false
                broadcast "&c[&4&lVoteDay&c] There are currently %{Votes}% / %round(number of all players/2)% for vote day."
            if {Votes} is higher than number of all players/2:
                set {Votes} to 0
                broadcast "&c[&4&lVoteDay&c] Setting time to day."
                set time in world("{@_world}") to 06:00
                set {canVote.%player%} to true
                stop
            else if {Votes} is equal to number of all players/2:
                set {Votes} to 0
                broadcast "&c[&4&lVoteDay&c] Setting time to day."
                set time in world("{@_world}") to 06:00
                set {canVote.%player%} to true
                stop
        else if {canVote.%player%} is false:
            send "&c[&4&lVoteDay&c] You have already voted during this day cycle." to the player
            stop
command /requiredvotes:
    description: Checks how many votes are votes are required for vote day
    permission: "ascal.admin"
    executable by: players
    trigger:
        message "{Required_Votes}"

Similar projects

Script →