Countdown

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

    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.

HCFSkybridge

Member
Jul 4, 2019
1
0
0
I want to make a countdown from 1 hour on my server so it’ll display 1 hour, 59 minutes 59 seconds, 59 minutes 58 second, etc for key-all’s. So it’ll countdown and when it hits 0 it’ll reset. Thanks!
 
I did this in 1 min:
Code:
on load:
    set {hour::*} to 1
    set {mins::*} to 59
    set {secs::*} to 59

every second:
    remove 1 from {secs::*}

    if {secs::*} = 0:
        remove 1 from {mins::*}

        if {mins::*} = 0
            remove 1 from {hour::*}

every second:
    if {hour::*} = 0:
        if {mins::*} = 0:
            if {secs::*} = 0:
                set {secs::*} to 59
                set {mins::*} to 59
                set {hour::*} to 1
            else:
                set {secs::*} to 59
        else:
            set {mins::*} to 59
    else:
        stop


command /countdown [<text>]:
    trigger:
        if arg-1 is not set:
            send "&cTime Left: &6%{hour::*}%&7hour(s), &5%{mins::*}%&7minute(s) and &a%{secs::*}%&7second(s)..."
        else:
            send "&fUnknown command."
 
Status
Not open for further replies.