So I'm creating a timed restart skript so when I do /tdr or /timedrestart in-game, the server will initiate a countdown which concludes in the server restarting. Now I also want to implement a cancel command to cancel the whole operation before the server restarts. I don't know how to do it and I've tried many different things.
command /timedrestart [<text>]:
aliases: tdr
permission: ai.timedrestart
permission message: &cYou are not permitted to use this command.
trigger:
If argument 1 is not set:
send "&8[&3&lA&b&lI&8] &cAtrium will be doing an emergency restart in &430&c seconds!"
wait 15 seconds
send "&8[&3&lA&b&lI&8] &cAtrium will restart in &415&c seconds!"
wait 5 seconds
send "&8[&3&lA&b&lI&8] &cAtrium will restart in &410&c seconds!"
wait 5 seconds
send "&8[&3&lA&b&lI&8] &cAtrium will restart in &45&c seconds!"
wait 5 seconds
send "&8[&3&lA&b&lI&8] &4&LSERVER RESTARTING!"
wait 1 second
execute console command "restart"
I've tried things like:
If argument 1 is "cancel":
cancel event
and among others. Anyone know how to do this properly? (Also the indentations aren't showing up for some reason but they're there)
command /timedrestart [<text>]:
aliases: tdr
permission: ai.timedrestart
permission message: &cYou are not permitted to use this command.
trigger:
If argument 1 is not set:
send "&8[&3&lA&b&lI&8] &cAtrium will be doing an emergency restart in &430&c seconds!"
wait 15 seconds
send "&8[&3&lA&b&lI&8] &cAtrium will restart in &415&c seconds!"
wait 5 seconds
send "&8[&3&lA&b&lI&8] &cAtrium will restart in &410&c seconds!"
wait 5 seconds
send "&8[&3&lA&b&lI&8] &cAtrium will restart in &45&c seconds!"
wait 5 seconds
send "&8[&3&lA&b&lI&8] &4&LSERVER RESTARTING!"
wait 1 second
execute console command "restart"
I've tried things like:
If argument 1 is "cancel":
cancel event
and among others. Anyone know how to do this properly? (Also the indentations aren't showing up for some reason but they're there)