Question

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

Kiri

Active Member
Jan 28, 2017
54
2
1
24
This is more of a question I've had for a while, but are there any ways to continue a process in skript even after restart?

Ex: if a skript has wait x seconds then do something, would there be way to process that even after restart if a restart occurs during the wait. Well, without the need to loop often.
 
I do believe so. This example isn't quite the same thing, but if the timespan is stored in variables, restart doesn't seem to affect it.
so in this skript, it's a chat cooldown, but if the time difference is still 'running' it will continue after a restart.
code_language.skript:
on chat:
    cancel event
    set {_chatcooldown} to difference between {chatcooldown.last.%player%} and now
    if {_chatcooldown} is less than 5 minutes:
        if {chatmessage.%player%} is equal to "%message%":
            send "That's the same as your last message. Wait 5 minutes to chat the same thing."
            stop
    set {chatmessage.%player%} to the message
    set {chatcooldown.last.%player%} to now
So the timer will pick up where it left off, I think, it seems that way in the few tests I just did.
 
I do believe so. This example isn't quite the same thing, but if the timespan is stored in variables, restart doesn't seem to affect it.
so in this skript, it's a chat cooldown, but if the time difference is still 'running' it will continue after a restart.
code_language.skript:
on chat:
    cancel event
    set {_chatcooldown} to difference between {chatcooldown.last.%player%} and now
    if {_chatcooldown} is less than 5 minutes:
        if {chatmessage.%player%} is equal to "%message%":
            send "That's the same as your last message. Wait 5 minutes to chat the same thing."
            stop
    set {chatmessage.%player%} to the message
    set {chatcooldown.last.%player%} to now
So the timer will pick up where it left off, I think, it seems that way in the few tests I just did.
Timespans don't use timers of any sort
 
Timespan works using hashmap and take the correctly time of when player execute the event action , then check the hashmap setted & if time required is passed out.

Hope im correct & you understand what i mean.
 
Timespan works using hashmap and take the correctly time of when player execute the event action , then check the hashmap setted & if time required is passed out.

Hope im correct & you understand what i mean.
I think so... it should still work for the OP right, after the server restarted? It works for chat but I may still be mixing up concepts here.
 
I understand that part, I'm more or so wondering about stuff outside of cooldown. Ex: on break of stone: wait 5 seconds - set event-block to stone
 
Status
Not open for further replies.