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!

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

olimajtor

Member
Sep 2, 2020
1
0
1
24
I want to make a countdown on my server something like /countdown 10
and it will spam in chat 10 9 8 7...

Sorry for my English :emoji_slight_smile:
 
Hi, sorry for late reply.

This should work, it's not tested because my minecraft is broken but good luck :emoji_slight_smile:

code_language.skript:
command /countdown 10:
    permission: countdown.admin
    trigger:
        broadcast "10"
        wait 1 second
        broadcast "9"
        wait 1 second
        broadcast "8"
        wait 1 second
        broadcast "7"
        wait 1 second
        broadcast "6"
        wait 1 second
        broadcast "5"
        wait 1 second
        broadcast "4"
        wait 1 second
        broadcast "3"
        wait 1 second
        broadcast "2"
        wait 1 second
        broadcast "1"

If there are any errors, reply to this post or DM me. Remember to set the post status to 'Solved' if this is what you wanted.

If it says you don't have permission grant yourself 'countdown.admin'

Good luck making and creating,

- TheCringleYT
 
Try this.

What this command does, is first set a temporary variable (this variable will be destroyed after the command ends) to the number you put in the command.
Then, while that variable is more than or equal to zero, it broadcasts the number, waits 1 second, then removes 1 from the temporary variable.
Then it continues until you get to zero, and at that point the command broadcasts "GO!", and the loop & command end.

If it says that you don't have permission, grant yourself countdown.use.

Btw, you can change "GO!" to anything you want.
code_language.skript:
command /countdown <number>:
    permission: countdown.use
    trigger:
        set {_temp} to arg
        while {_temp} >= 0:
            if {_temp} = 0:
                broadcast "GO!"
                stop loop
            broadcast "%{_temp}%"
            wait 1 second
            set {_temp} to {_temp}-1

So for example you type /countdown 5.
The command will broadcast:
5
4
3
2
1
GO!
 
Last edited:
Status
Not open for further replies.