Timer

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

human

Member
Jul 23, 2019
2
0
0
24
I am trying to make a timer for 7 days like a hologram for 7 days, and resets automatically.

I tried doing this with Command Blocks and redstone but all ideas failed horribly so if someone could help me i love u
 
Code:
options:
    perm: Holo.Reset #The permission to reset the command
    permmessage: &cYou do not have the right permission! #Permission message
    holoname: Reset #Name of the hologram
    line: 1 #The line that should be reset

variables:
    {hologram.message} = Default message #The message that it should be changed to after reset

command /resethologram:
    permission: {@perm}
    permission message: {@permmessage}
    trigger:
        set {hologram.start} to now
        execute console command "/hd setline {@holoname} {@line} %{hologram.message}%"
        send "Did reset hologram {@holoname}" to console
        send "Did reset hologram {@holoname}" to player

every second:
    if {hologram.start} isn't set:
        stop
    set {_dif} to difference between {hologram.start} and now
    if {_dif} is greater or equal to 7 days:
        execute console command "/resethologram"

I think it work.. You can try it and report errors back
[doublepost=1564593395,1564593274][/doublepost]Btw, timers can be like this:
Code:
set {timestart} to now #the beginning of the timer
set {_dif} to difference between {timestart} and now #Calculate the time
#{_Dif} is now the final result