Count command occurences

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Vaw

Member
Mar 22, 2017
4
0
0
26
I'm hoping to find a way for a certain action to occur if several players run a command within a certain amount of time. For example, if three players did /voteday within five minutes of each other, console would run the command /time set 0.
 
Hmm... its more than request?

always here, hope its working fine. Not tested because im alone for ever.

code_language.skript:
command /voteday:
    trigger:
        set {_time} to difference between {VoteDay} and now
        if {VoteDay} is less than 5 minutes:#If already vote passed. he need wait next 5 minutes to start again
            send "&cSorry. but vote has already passed. you need wait a little."
        else:
            if {VotePlayer::%player%} is set:
                send "&cYou can't vote 2x times!"
                stop
            if {VoteCount} is not set:
                set {_a} to 60#60 seconds have people time, for vote.
            add 1 to {VoteCount}
            set {VotePlayer::%player%}
            broadcast "%player% vote for day!"
            if {VoteCount} is more than or equal to 3:#Need 3 People to get vote day.
                broadcast "Vote for day won!"
                make console execute command "/time set 0"
                delete {VotePlayer::*}
                delete {VoteCount}
                set {VoteDay} to now
            else:
                broadcast "&8&l""&e/voteday&8&l"" &6to vote! %3 - {VoteCount}% Vote need!"
            while {_a} is not 0:
                subtract 1 from {_a}
                wait a seconds
            if {VoteCount} is set:
                broadcast "&c&lVote for day is failed. Not enough people to vote!"
                delete {VotePlayer::*}
                delete {VoteCount}
                set {VoteDay} to now
 
Status
Not open for further replies.