How to stop the events of another command happening

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

Absorptionn

Member
May 11, 2019
3
0
0
23
Hello guys, so i am looking for some help here.
I have a skript currently with two commands in them.
One being /start the other being /stop.
If i do /stop how do i make the events of /start not happen if that makes sense.

Thanks!
 
You can use variables in order to do this. And maybe "every 1 second" too?
[doublepost=1557587546,1557587442][/doublepost]You cant do this if command "stop" has already ran. Like if you put a command in "/stop":
make player execute command "stop"
then you cant stop that event cuz it has already been done and has already been executed.
 
/start is a 50 minute long skript, it includes alot of waiting before something happens as i am hosting a UHC game.

I want to make it so when i do /stop, it cancels what would of happened in the future of the /uhcstart command.

If that makes sense? Lol
 
Hmm
You could use a variable like I said.
So before waiting, you can add a line. For Example here's a quick code to tell u:
Code:
command /togglestop:
    trigger:
        if {stop} is true:
            set {stop} to false
        else:
            set {stop} to true
command /uhc:
    trigger:
        {stop} is false
        send "hello"
        {stop} is false
        wait 1 tick
        send "lol"
        {stop} is false
        send "omg stop is still false!!!"
        {stop} is false
        send "omg!!!!!!!! IT IS STILL GOING!!"
Something like that maybe :emoji_stuck_out_tongue:
You could also add "wait (timespan)" in the middle of the lines, it really doesn't matter
EDIT: You also need to add this code to ur skript:

Code:
on load:
    set {stop} to false
 
Last edited:
This is an example:
Code:
command /uhcstop:
    trigger:
        set {somethinghere} to false
        send "&aA weird message."
command /uhcstart:
    trigger:
        set {somethinghere} to true
        send "&cAnother wierd message"
I hope this what you wanted, in /uhcstart its setting the {somethinghere} to true and in /uhcstop it sets {somethinghere} to false.
 
This is an example:
Code:
command /uhcstop:
    trigger:
        set {somethinghere} to false
        send "&aA weird message."
command /uhcstart:
    trigger:
        set {somethinghere} to true
        send "&cAnother wierd message"
I hope this what you wanted, in /uhcstart its setting the {somethinghere} to true and in /uhcstop it sets {somethinghere} to false.
No I don't think u know what he wants. He wants something like this that if he runs command "/start" then the command starts doing something but as soon as he runs the command "/stop" it stops what "/start" is doing. It's kinda confusing.
 
Use a while loop

Example:

Code:
command /uhcstart:
    trigger:
        while {uhcstart} is not set:
            #Do stuff
            wait 3 ticks
        # Do stuff when game is stopped
        delete {uhcstart}

command /uhcstop:
    trigger:
        set {uhcstart} to true
 
Status
Not open for further replies.