time remaining...

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

FallingCatus

Member
Jun 29, 2017
38
0
6
33
Hi,
So I have a basic skript running on my server that auto restarts my server after a set time but i was wondering if there would be a way to add a command to show how much time remains till the restart? like /restarttime or something... Is that possible? I am no Skript god so dont dont laugh at my basic skript! ahah...

code_language.skript:
on load:
    wait 2 seconds
    send "&7+-------------- &aCactus&eAuto&cRestart --------------+" to console
    send "&f" to console
    send "&fThe restart procedure has now started." to console
    send "&f" to console
    send "&f" to console
    wait 11 hours
    broadcast "&eServer Will Restart In &c1 &eHour!"
    wait 30 minutes
    broadcast "&eServer Will Restart In &c30 &eMinutes!"
    wait 20 minutes
    broadcast "&eServer Will Restart In &c10 &eMinutes!"
    execute console command "/tm bc &eServer Restart In\n&c10 Minutes!"
    wait 5 minutes
    broadcast "&eServer Will Restart In &c5 &eMinutes!"
    wait 4 minutes
    broadcast "&eServer Will Restart In &c1 &eMinute!"
    execute console command "/tm bc &eServer Restart In\n&c1 Minute!"
    wait 30 seconds
    broadcast "&eServer Will Restart In &c30 &eSeconds!"
    wait 20 seconds
    broadcast "&eServer Will Restart In &c10 &eSeconds!"
    wait 5 seconds
    broadcast "&eServer Will Restart In &c5 &eSeconds!"
    execute console command "/tm bc &c&l5"
    wait 1 seconds
    broadcast "&c4"
    execute console command "/tm bc &c&l4"
    wait 1 seconds
    broadcast "&c3"
    execute console command "/tm bc &c&l3"
    wait 1 seconds
    broadcast "&c2"
    execute console command "/tm bc &c&l2"
    wait 1 seconds
    broadcast "&c1"
    execute console command "/tm bc &c&l1"
    wait 1 seconds
    broadcast "&cNow!"
    execute console command "/tm bc &c&lNow!"
    wait 1 seconds
    execute console command "/essentials:kickall &b&lWe're sorry! \n&7 \n &e&lThe &c&lSurvival &e&lserver is restarting! \n&7 \n &7This is automatic and should only be a minute!"
    execute console command "/essentials:kick FallingCactus &b&lWe're sorry! \n&7 \n &e&lThe &c&lSurvival &e&lserver is restarting! \n&7 \n &7This is automatic and should only be a minute!"
    wait 3 seconds
    execute console command "/spigot:restart"
 
Last edited:
You can try to set a variable on load and in the command you use that to check the remaining time
 
Maybe this can help you:
code_language.skript:
on load:
    set {variable} to now
    
command /remaining:
    trigger:
        set {_t} to difference between now and {variable}
        set {_t2} to 1 hour # set this to the sum of all of your timespans
        remove {_t} from {_t2}
        message "Remaining: %{_t2}%"
 
Status
Not open for further replies.