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

Solved titles

Discussion in 'Skript' started by Maezukie, Aug 24, 2018.

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

    Maezukie Member

    Joined:
    May 21, 2018
    Messages:
    15
    Likes Received:
    0
    Code (Skript):
    1. at 06:00:
    2.     time is 6 am
    3.     send players title "&6Morning" with subtitle "&f6:00 am"
    4.     execute console command "/Period Morning"
    5.     loop 1 times:
    6.         execute console command "/time add 1"
    7.  
    8.  
    9.  
    10. at 07:20:
    11.     time is 7:20 am
    12.     if {day} is not "Saturday" or "Sunday":
    13.         send players title "&6Before school" with subtitle "&f7:20 am"
    14.         execute console command "/Period Before school"
    15.         loop 1 times:
    16.             execute console command "/time add 1"
    17.             stop
    18.     else:
    19.         execute console command "/Period No School"
    20.         loop 1 times:
    21.             execute console command "/time add 1"
    22.             stop
    23.  
    24.  
    25. at 08:20:
    26.     time is 8:20 am
    27.     if {day} is not "Saturday" or "Sunday":
    28.         send players title "&6Before Class" with subtitle "&f8:20 am"
    29.         execute console command "/Period Before Class"
    30.         loop 1 times:
    31.             execute console command "/time add 1"
    32.             stop
    33.     else:
    34.         execute console command "/Period No School"
    35.         loop 1 times:
    36.             execute console command "/time add 1"
    37.             stop
    38.  
    39. at 08:30:
    40.     time is 8:30 am
    41.     if {day} is not "Saturday" or "Sunday":
    42.         send players title "&6Period 1" with subtitle "&f8:30 am"
    43.         execute console command "/Period 1"
    44.         loop 1 times:
    45.             execute console command "/time add 1"
    46.             stop
    47.     else:
    48.         execute console command "/Period No School"
    49.         loop 1 times:
    50.             execute console command "/time add 1"
    51.             stop
    52.  
    53. at 09:20:
    54.     time is 9:20 am
    55.     if {day} is not "Saturday" or "Sunday":
    56.         send players title "&6Period 2" with subtitle "&f9:20 am"
    57.         execute console command "/Period 2"
    58.         loop 1 times:
    59.             execute console command "/time add 1"
    60.     else:
    61.         execute console command "/Period No School"
    62.         loop 1 times:
    63.             execute console command "/time add 1"
    64.             stop
    65.  
    66. at 10:10:
    67.     time is 10:10 am
    68.     if {day} is not "Saturday" or "Sunday":
    69.         send players title "&6Form time" with subtitle "&f10:10 am"
    70.         execute console command "/Period Form time"
    71.         loop 1 times:
    72.             execute console command "/time add 1"
    73.     else:
    74.         execute console command "/Period No School"
    75.         loop 1 times:
    76.             execute console command "/time add 1"
    77.             stop
    78.  
    79. at 10:35:
    80.     time is 10:35 am
    81.     if {day} is not "Saturday" or "Sunday":
    82.         send players title "&6Break time" with subtitle "&f10:35 am"
    83.         execute console command "/Period Break time"
    84.         loop 1 times:
    85.             execute console command "/time add 1"
    86.     else:
    87.         execute console command "/Period No School"
    88.         loop 1 times:
    89.             execute console command "/time add 1"
    90.             stop
    91.  
    92. at 11:00:
    93.     time is 11:00 am
    94.     if {day} is not "Saturday" or "Sunday":
    95.         send players title "&6Period 3" with subtitle "&f11:00 am"
    96.         execute console command "/Period 3"
    97.         loop 1 times:
    98.             execute console command "/time add 1"
    99.     else:
    100.         execute console command "/Period No School"
    101.         loop 1 times:
    102.             execute console command "/time add 1"
    103.             stop
    104.  
    105. at 11:50:
    106.     time is 11:50 am
    107.     if {day} is not "Saturday" or "Sunday":
    108.         send players title "&6Period 4" with subtitle "&f11:50 am"
    109.         execute console command "/Period 4"
    110.         loop 1 times:
    111.             execute console command "/time add 1"
    112.     else:
    113.         execute console command "/Period No School"
    114.         loop 1 times:
    115.             execute console command "/time add 1"
    116.             stop
    117.  
    118. at 12:40:
    119.     time is 12:40 am
    120.     if {day} is not "Saturday" or "Sunday":
    121.         send players title "&6Lunch time" with subtitle "&f12:40 am"
    122.         execute console command "/Period Lunch time"
    123.         loop 1 times:
    124.             execute console command "/time add 1"
    125.     else:
    126.         execute console command "/Period No School"
    127.         loop 1 times:
    128.             execute console command "/time add 1"
    129.             stop
    130.  
    131. at 13:20:
    132.     time is 1:20 pm
    133.     if {day} is not "Saturday" or "Sunday":
    134.         send players title "&6Period 5" with subtitle "&f1:20 pm"
    135.         execute console command "/Period 5"
    136.         loop 1 times:
    137.             execute console command "/time add 1"
    138.     else:
    139.         execute console command "/Period No School"
    140.         loop 1 times:
    141.             execute console command "/time add 1"
    142.             stop
    143.  
    144.  
    145. at 14:10:
    146.     time is 2:10 pm
    147.     if {day} is not "Saturday" or "Sunday":
    148.         send players title "&6Period 6" with subtitle "&f2:10 pm"
    149.         execute console command "/Period 6"
    150.         loop 1 times:
    151.             execute console command "/time add 1"
    152.     else:
    153.         execute console command "/Period No School"
    154.         loop 1 times:
    155.             execute console command "/time add 1"
    156.             stop
    157.  
    158.  
    159. at 15:00:
    160.     time is 3 pm
    161.     if {day} is not "Saturday" or "Sunday":
    162.         send players title "&6Hometime" with subtitle "&f3:00 pm"
    163.         execute console command "/Period Hometime"
    164.         loop 1 times:
    165.             execute console command "/time add 1"
    166.     else:
    167.         execute console command "/Period No School"
    168.         loop 1 times:
    169.             execute console command "/time add 1"
    170.             stop
    171.  
    172. at 15:20:
    173.     time is 3:20 pm
    174.     if {day} is not "Saturday" or "Sunday":
    175.         send players title "&6After school" with subtitle "&f3:20 pm"
    176.         execute console command "/Period After school"
    177.         loop 1 times:
    178.             execute console command "/time add 1"
    179.     else:
    180.         execute console command "/Period No School"
    181.         loop 1 times:
    182.             execute console command "/time add 1"
    183.             stop
    184.  
    185. at 21:00:
    186.     time is 9 pm
    187.     send players title "&6Night time" with subtitle "&f9:00 pm"
    188.     execute console command "/Period Night time"
    189.     loop 1 times:
    190.         execute console command "/time add 1"
    191.  
    192. at 23:59:
    193.     time is 11:59 am
    194.     send players title "&6MidNight" with subtitle "&f12:00 pm"
    195.     execute console command "/Period midnight"
    196.     loop 1 times:
    197.         execute console command "/time add 1"
    198.     if {day} is "Monday":
    199.         execute console command "/day Tuesday"
    200.     if {day} is "Tuesday":
    201.         execute console command "/day Wednesday"
    202.     if {day} is "Wednesday":
    203.         execute console command "/day Thursday"
    204.     if {day} is "Thursday":
    205.         execute console command "/day Friday"
    206.     if {day} is "Friday":
    207.         execute console command "/day Saturday"
    208.     if {day} is "Saturday":
    209.         execute console command "/day Sunday"
    210.     if {day} is "Sunday":
    211.         execute console command "/day Monday"
    so theres no errors in the code but at say 8:30 it will broadcast period 1 then broadcast period 4 when its not even the time?
     
  2. Best Answer:
    Post #2 by jaylawl, Aug 25, 2018
  3. jaylawl

    jaylawl Well-Known Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    afaik the "at time" event is currently broken: https://github.com/SkriptLang/Skript/issues/463
    apart from that, there's a lot wrong with your code. "loop 1 times" is fully redundant

    as a workaround you could do this:
    Code (Skript):
    1. every minute:
    2.     if time = 0:00:
    3.         #do this code
    4.     else if time = 1:00:
    5.         #do this code instead
    6.     else if time = ...
     
Thread Status:
Not open for further replies.
Loading...