[SKRIPT] Formatted 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 comminuty!

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

DavidWasHere

New Member
Nov 14, 2020
6
0
1
23
Category: Skript?

Suggested name: Countdown

Spigot/Skript Version: 1.16.3

What I want:
A formatted countdown (03:00, 02:59 etc) that works in the scoreboard

Ideas for commands:
/countdown start [minutes] (For example: /countdown start 6)
/countdown pause
/countdown stop

Ideas for permissions:
None

When I'd like it by: Anytime
 
I'd like to know if you have any scoreboard setup yet and if you are planning to have one in order to do this.
 
ima try and do it but idk how its gonna go. dont expect for too much
[doublepost=1606675236,1606670890][/doublepost]
Category: Skript?

Suggested name: Countdown

Spigot/Skript Version: 1.16.3

What I want:
A formatted countdown (03:00, 02:59 etc) that works in the scoreboard

Ideas for commands:
/countdown start [minutes] (For example: /countdown start 6)
/countdown pause
/countdown stop

Ideas for permissions:
None

When I'd like it by: Anytime
I looked deeper into this and I just realized I coded a whole skript breaking my head how to make a pause. when I realized u want it on scoreboard and on 1.16 which I dont code at.
good job me
good reading skills
 
Code:
options:
    prefix: &3Countdown &8>
#messages
    permission: countdown.use
    nopermission: &cYou don't have permission to set the Countdown
    TooMuch: &cThis Argument is too much
    CountdownSet: &6The &3Countdown &6was set to &c%{Counter.Zahl}%
    Finish: &cCountdown finished
    
#----------------------------------------------------------------------------------       
command /countdown [<number>]:
    trigger:
        if player has the permission "{@permission}":
            if arg isn't set:
                send "{@prefix} &7Argumente&8: &c1 &8- &c60"
                stop trigger
            if arg 1 is greater than 60:
                send "{@prefix} {@TooMuch}"
                stop
            set {Counter.Zahl} to arg 1
            set {Counter.Online} to true
            loop {Counter.Zahl} times:
                if {Counter.Online} is true:
                    make player execute command "scoreboard-refresh"
                    broadcast "{@prefix} {@CountdownSet}"
                    remove 1 from {Counter.Zahl}
                    wait 1 second   
                    if {Counter.Zahl} is 0:
                        if {Counter.Online} is true:
                            set {Counter.Online} to false
                            broadcast "{@prefix} {@Finish}"
                            make player execute command "scoreboard-aus"
                            stop
        else:
            send player title "{@prefix}" with subtitle "{@nopermission}" for 2 seconds
            send action bar from "{@prefix} {@nopermission}" to player
            message "{@prefix} {@nopermission}"
command /scoreboard-refresh:
    trigger:
        wipe player sidebar
        set name of sidebar of player to  " "
        wipe player sidebar
        set name of sidebar of player to "{@prefix}"
        set score "&7▬▬▬&8▬▬▬▬▬▬▬▬▬▬▬▬▬▬&7▬▬▬" in sidebar of player to 4
        set score "&3Countdown:" in sidebar of player to 3
        set score "&a» &7%{Counter.Zahl}% &3sec" in sidebar of player to 2
        set score "&8▬▬▬&7▬▬▬▬▬▬▬▬▬▬▬▬▬▬&8▬▬▬" in sidebar of player to 1
        
command /scoreboard-aus:
    trigger:
        wipe player sidebar
        set name of sidebar of player to  " "
 
Code:
options:
    prefix: &3Countdown &8>
#messages
    permission: countdown.use
    nopermission: &cYou don't have permission to set the Countdown
    TooMuch: &cThis Argument is too much
    CountdownSet: &6The &3Countdown &6was set to &c%{Counter.Zahl}%
    Finish: &cCountdown finished
   
#----------------------------------------------------------------------------------      
command /countdown [<number>]:
    trigger:
        if player has the permission "{@permission}":
            if arg isn't set:
                send "{@prefix} &7Argumente&8: &c1 &8- &c60"
                stop trigger
            if arg 1 is greater than 60:
                send "{@prefix} {@TooMuch}"
                stop
            set {Counter.Zahl} to arg 1
            set {Counter.Online} to true
            loop {Counter.Zahl} times:
                if {Counter.Online} is true:
                    make player execute command "scoreboard-refresh"
                    broadcast "{@prefix} {@CountdownSet}"
                    remove 1 from {Counter.Zahl}
                    wait 1 second  
                    if {Counter.Zahl} is 0:
                        if {Counter.Online} is true:
                            set {Counter.Online} to false
                            broadcast "{@prefix} {@Finish}"
                            make player execute command "scoreboard-aus"
                            stop
        else:
            send player title "{@prefix}" with subtitle "{@nopermission}" for 2 seconds
            send action bar from "{@prefix} {@nopermission}" to player
            message "{@prefix} {@nopermission}"
command /scoreboard-refresh:
    trigger:
        wipe player sidebar
        set name of sidebar of player to  " "
        wipe player sidebar
        set name of sidebar of player to "{@prefix}"
        set score "&7▬▬▬&8▬▬▬▬▬▬▬▬▬▬▬▬▬▬&7▬▬▬" in sidebar of player to 4
        set score "&3Countdown:" in sidebar of player to 3
        set score "&a» &7%{Counter.Zahl}% &3sec" in sidebar of player to 2
        set score "&8▬▬▬&7▬▬▬▬▬▬▬▬▬▬▬▬▬▬&8▬▬▬" in sidebar of player to 1
       
command /scoreboard-aus:
    trigger:
        wipe player sidebar
        set name of sidebar of player to  " "
i dont feel like i should interrupt, but he said a pause & a cancel.