[Cancel Command]

I create a minigame that consists of a countdown, when it reaches 0 it kills you. How could I do it so that, if it arrives before 0 to the goal or presses a button, cancel the kill and give you a reward?

I’m interested in the answer

Making no sense since 2002™

IGN/Gamertag: JaxThePerson
Discord: JaxThePerson#8819

I own a server named OzoneHaven! Join it at ozonehaven.us.to: 39177.
Vote: http://bit.do/ozonevote
Forum: http://bit.do/ozoneforum
Discord: https://discord.gg/Une7Xrs

It actually depends on how you made the cooldown
Did you use sleep or you put it in variables then put sleep?

My Server

If you need help goto: support.leet.cc
Or PM me here or on Discord: @Ammarking#7494
I usually reply on Thursdays.

@Ammarking

Using the “Sleep”:

/ cmd add sp ascon title %p% actionbar [10]
/ cmd add sp sleep 1

If you’ve already made a way to register players who are playing your minigame, you can use this action on a button:
/cmd insert minigame 1001 \%fp\% = \%fp\% - %p
Then the command should be like this:
(The participating players are set in the variable %pp% in an array)

...cmd add minigame %fp% = %pp%
cmd add minigame sleep (amount of seconds you want to give them)
cmd add minigame goto 1000
cmd add minigame %sizefp% = size(%fp%) - 1
cmd add minigame ascon /kill %fp%[%sizefp%]
cmd add minigame if %sizefp% = 0 then goto **
cmd add minigame %sizefp% = %sizefp% - 1
cmd add minigame ascon /kill %fp%[%sizefp%]
cmd add minigame goto (line containing if %sizefp% = 0 then goto **)
cmd add minigame exit (this is where the command will end, so if you want it to add more, you can continue here)
cmd add minigame ascon /kill %fp%[0]
cmd edit minigame 1000 #substract
cmd add minigame goto (line containing %sizefp% = size(%fp%) - 1)
Log in to reply

Looks like your connection to LEET Forums was lost, please wait while we try to reconnect.