Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /timer <number> [<number>] [<boolean>]:
- usage: "&d/timer &e<limit&9:int&e> [countdown&9:int&e] [limit-msg&9:bool&e]"
- permission: skript.admin
- trigger:
- if arg 1 is 0:
- if {timer.use} is true:
- set {timer.use} to false
- set {timer.sec} to 0
- set {timer.msg} to false
- message "&2Success: &asuccess of timer reset."
- stop
- else:
- message "&4Error: &cfailure of timer reset. ('0' is timer reset.)"
- else if {timer.use} is true:
- message "&4Error: &ctimer is already running. ('0' is timer reset.)"
- if arg 1 is less than 1:
- message "&4Error: &cplease natural number."
- stop
- if arg 2 is more than 0:
- if arg 3 is true:
- message "&2Success: &atimer starting. (countdown: %arg 2%s, message: true)"
- set {timer.msg} to true
- else:
- message "&2Success: &atimer starting. (countdown: %arg 2%s)"
- loop arg 2 times:
- set {_countdown} to arg 2-loop-number+1
- broadcast "&e&l[Timer] &7&o<Count Down> &b%{_countdown}%..."
- execute console command "/execute @a ~ ~ ~ playsound block.note.bass master @p"
- wait 20 ticks
- else:
- message "&2Success: &atimer starting."
- set {timer.use} to true
- set {timer.sec} to arg 1
- execute console command "/execute @a ~ ~ ~ playsound block.note.pling master @p"
- broadcast "&e&l[Timer] &b&lTimer Starting!"
- loop {timer.sec} times:
- if {timer.use} is false:
- exit loop
- execute console command "/title @a actionbar [{""text"":""[Time Left] "",""color"":""gold"",""bold"":true},{""text"":""%{timer.sec}%"",""color"":""aqua"",""bold"":true}]"
- wait 20 ticks
- remove 1 from {timer.sec}
- if {timer.msg} is true:
- if {timer.sec} is 180:
- broadcast "&e&l[Timer] &dTime Left is &l180s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 150:
- broadcast "&e&l[Timer] &dTime Left is &l150s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 120:
- broadcast "&e&l[Timer] &dTime Left is &l120s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 90:
- broadcast "&e&l[Timer] &dTime Left is &l90s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 60:
- broadcast "&e&l[Timer] &dTime Left is &l60s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 30:
- broadcast "&e&l[Timer] &dTime Left is &l30s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 20:
- broadcast "&e&l[Timer] &dTime Left is &l20s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 10:
- broadcast "&e&l[Timer] &dTime Left is &l10s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 9:
- broadcast "&e&l[Timer] &dTime Left is &l9s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 8:
- broadcast "&e&l[Timer] &dTime Left is &l8s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 7:
- broadcast "&e&l[Timer] &dTime Left is &l7s."
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- if {timer.sec} is 6:
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- broadcast "&e&l[Timer] &dTime Left is &l6s."
- if {timer.sec} is 5:
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- broadcast "&e&l[Timer] &dTime Left is &l5s."
- if {timer.sec} is 4:
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- broadcast "&e&l[Timer] &dTime Left is &l4s."
- if {timer.sec} is 3:
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- broadcast "&e&l[Timer] &dTime Left is &l3s."
- if {timer.sec} is 2:
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- broadcast "&e&l[Timer] &dTime Left is &l2s."
- if {timer.sec} is 1:
- execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
- broadcast "&e&l[Timer] &dTime Left is &l1s."
- broadcast "&e&l[Timer] &bTimer Finish."
- execute console command "/execute @a ~ ~ ~ playsound entity.generic.burn master @p"
- execute console command "/title @a actionbar [{""text"":""[Time Left] "",""color"":""gold"",""bold"":true},{""text"":""0"",""color"":""aqua"",""bold"":true}]"
- set {timer.use} to false
- set {timer.msg} to false
Advertisement
Add Comment
Please, Sign In to add comment