1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

time remaining...

Discussion in 'Skript' started by FallingCatus, Nov 8, 2018.

Thread Status:
Not open for further replies.
  1. FallingCatus

    FallingCatus Member

    Joined:
    Jun 29, 2017
    Messages:
    38
    Likes Received:
    0
    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 (Skript):
    1. on load:
    2.     wait 2 seconds
    3.     send "&7+-------------- &aCactus&eAuto&cRestart --------------+" to console
    4.     send "&f" to console
    5.     send "&fThe restart procedure has now started." to console
    6.     send "&f" to console
    7.     send "&f" to console
    8.     wait 11 hours
    9.     broadcast "&eServer Will Restart In &c1 &eHour!"
    10.     wait 30 minutes
    11.     broadcast "&eServer Will Restart In &c30 &eMinutes!"
    12.     wait 20 minutes
    13.     broadcast "&eServer Will Restart In &c10 &eMinutes!"
    14.     execute console command "/tm bc &eServer Restart In\n&c10 Minutes!"
    15.     wait 5 minutes
    16.     broadcast "&eServer Will Restart In &c5 &eMinutes!"
    17.     wait 4 minutes
    18.     broadcast "&eServer Will Restart In &c1 &eMinute!"
    19.     execute console command "/tm bc &eServer Restart In\n&c1 Minute!"
    20.     wait 30 seconds
    21.     broadcast "&eServer Will Restart In &c30 &eSeconds!"
    22.     wait 20 seconds
    23.     broadcast "&eServer Will Restart In &c10 &eSeconds!"
    24.     wait 5 seconds
    25.     broadcast "&eServer Will Restart In &c5 &eSeconds!"
    26.     execute console command "/tm bc &c&l5"
    27.     wait 1 seconds
    28.     broadcast "&c4"
    29.     execute console command "/tm bc &c&l4"
    30.     wait 1 seconds
    31.     broadcast "&c3"
    32.     execute console command "/tm bc &c&l3"
    33.     wait 1 seconds
    34.     broadcast "&c2"
    35.     execute console command "/tm bc &c&l2"
    36.     wait 1 seconds
    37.     broadcast "&c1"
    38.     execute console command "/tm bc &c&l1"
    39.     wait 1 seconds
    40.     broadcast "&cNow!"
    41.     execute console command "/tm bc &c&lNow!"
    42.     wait 1 seconds
    43.     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!"
    44.     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!"
    45.     wait 3 seconds
    46.     execute console command "/spigot:restart"
     
    #1 FallingCatus, Nov 8, 2018
    Last edited: Nov 8, 2018
  2. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    You can try to set a variable on load and in the command you use that to check the remaining time
     
  3. FallingCatus

    FallingCatus Member

    Joined:
    Jun 29, 2017
    Messages:
    38
    Likes Received:
    0
    what would be the varible to add? as I am still trying to learn Skript. sorry
     
  4. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    Maybe this can help you:
    Code (Skript):
    1. on load:
    2.     set {variable} to now
    3.    
    4. command /remaining:
    5.     trigger:
    6.         set {_t} to difference between now and {variable}
    7.         set {_t2} to 1 hour # set this to the sum of all of your timespans
    8.         remove {_t} from {_t2}
    9.         message "Remaining: %{_t2}%"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...