How to cancel wait?

  • Thread starter Deleted member 1700
  • Start date
  • 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.
D

Deleted member 1700

How would I cancel the following line preventing any further code from being executed unless it is relaunched?

code_language.skript:
wait 10 seconds

The only thing that seems to cancel this task is by restarting the server. Is there a way to cancel this task by using another command?

Skript Version: 2.2-dev20
Skript Author: Njol, Mirreski, bensku, nfell2009, joeuguce99, RealGatt, RoyCurtis and tim740
Minecraft Version: 1.8.9
---
Full Code:

code_language.skript:
command /test <text>:
   description: Test
   usage: /test <on/off>
   permission: test.test
   executable by: players and console
   trigger:
       if "%arg text%" is "on":
           message "1"
           wait 10 seconds
           message "2"
       else if "%arg text%" is "off":
           #Check if there are any wait going on in this script and cancel them, preventing any further code from being executed

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? No
What other methods have you tried to fix it? The only method which seems to do what I want is by restarting the server. However, I don't want to restart the whole server just to stop one task.
 
Last edited by a moderator:
@nelson2tm

It's just a little example
code_language.skript:
set {_cooldown} to 10
while {_cooldown} is more than 0:
    set {cooldown.status} to true
    remove 1 from {_cooldown}
    wait 1 second
delete {cooldown.status}
You can do the same using loops
 
Status
Not open for further replies.