Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Timer Skript by D4mnX
- # Legaldog: I PROVIDE NO RESPONSIBILITY FOR ANY DAMAGES THAT RESULT DUE TO USAGE OF THIS SKRIPT. USE AT YOUR OWN RISK.
- # Legaldog OUT
- options:
- # Prefix of broadcast timer messages
- TimerBC : &8[&bFavonius&8]&r
- # Prefix of all OP messages
- TimerOP : &8[&bFavonius&8]&r
- UseInternalCommands : true
- # Check frequency, in ticks.
- CheckFrequency : 40
- # Command to start the timer
- command /timer-start [<integer=90>] [<integer=20>]:
- description: Starts the timer
- usage: /timer-start <Min. until Meetup> [<Min. Until PvP>]
- permission: skript.timer.start
- trigger:
- set {_LocalTime} to now
- # Timer already running?
- if {Timer.Running} is true:
- message "{@TimerOP} The Timer is already running!"
- stop trigger
- # No negative times
- if arg 1 is less than 1:
- message "{@TimerOP} Please enter a positive time!"
- stop trigger
- # Check if the broadcast array exists
- if {Timer.Array::*} is not set:
- message "{@TimerOP} eWARNING&r: No broadcast array found!"
- message "{@TimerOP} Using the default array."
- execute console command "/timer-array-reset"
- # Initialize variables
- set {Timer.Running} to true
- set {Timer.StartTime} to {_LocalTime}
- set {Timer.MinutesPassed} to 0
- set {Timer.MeetupAt} to arg 1
- # Broadcast the timer has started
- broadcast "{@TimerBC} &e%{Timer.MeetupAt}% &rminutes&r remain until &cMeetup!"
- # PvP Stuff
- if arg 2 is set:
- if {Timer.Mole} is not set:
- broadcast "{@TimerBC} &cPvP &rwill be enabled in &e%arg 2% &rminutes!"
- if {Timer.Mole} is true:
- broadcast "{@TimerBC} &cPvP&r/&cMoles &rin &c%arg 2% &rminutes!"
- set {Timer.PvPCheck} to true
- set {Timer.PvPAt} to arg 2
- # Message OPs who started a timer
- command /timer-stop:
- description: Stops the timer
- usage: /timer-stop
- permission: skript.timer.stop
- trigger:
- # Timer even running?
- if {Timer.Running} is not set:
- message "{@TimerOP} The timer is not running!"
- stop trigger
- # Delete variables
- delete {Timer.Running}
- delete {Timer.StartTime}
- delete {Timer.MinutesPassed}
- delete {Timer.MeetupAt}
- delete {Timer.PvPCheck}
- delete {Timer.PvPAt}
- delete {Timer.PauseTime}
- # Broadcast the stopping of the timer
- broadcast "{@TimerBC} The timer has stopped."
- # Message OPs who stopped the timer.
- if command sender is not the console:
- loop all players:
- loop-player has the permission "skript.timer.stop.notify"
- loop-player is not the command sender
- message "{@TimerOP} &e%command sender% &rstopped the timer&7." to loop-player
- command /timer-pause:
- description: Pause the timer
- usage: /timer-pause
- permission: skript.timer.pause
- trigger:
- set {_LocalTime} to now
- # Timer even running?
- if {Timer.Running} is not set:
- message "{@TimerOP} The Timer is not running!"
- stop trigger
- # Timer already paused?
- if {Timer.Paused} is true:
- message "{@TimerOP} The Timer is already paused!"
- stop trigger
- set {Timer.Paused} to true
- set {Timer.PauseTime} to {_LocalTime}
- # Broadcast the pausing of the timer
- broadcast "{@TimerBC} The Timer has been paused!"
- # Message OPs who paused the timer
- if command sender is not the console:
- loop all players:
- loop-player has the permission "skript.timer.pause.notify"
- loop-player is not the command sender
- message "{@TimerOP} &e%command sender% &rpaused the timer." to loop-player
- command /timer-resume:
- description: Resume the timer
- usage: /timer-resume
- permission: skript.timer.resume
- trigger:
- set {_LocalTime} to now
- if {Timer.Paused} is not set:
- message "{@TimerOP} The Timer is not paused!"
- stop trigger
- # Fixing the start time by adding the time the timer was paused
- set {_Difference} to difference between {Timer.PauseTime} and {_LocalTime}
- set {Timer.StartTime} to {Timer.StartTime}+{_Difference}
- # Deleting the unnecessary variables
- delete {Timer.Paused}
- delete {Timer.PauseTime}
- # Broadcast the resuming of the timer
- broadcast "{@TimerBC} The Timer has been resumed!"
- # Message OPs who resumed the timer
- if command sender is not the console:
- loop all players:
- loop-player has the permission "skript.timer.resume.notify"
- loop-player is not the command sender
- message "{@TimerOP} &e%command sender% &rresumed the timer." to loop-player
- command /timer-array-reset:
- description: Reset the broadcast array of the timer
- usage: /timer-array-reset
- permission: skript.timer.array.reset
- trigger:
- delete {Timer.Array::*}
- add 1 to {Timer.Array::*}
- add 2 to {Timer.Array::*}
- add 3 to {Timer.Array::*}
- add 4 to {Timer.Array::*}
- add 5 to {Timer.Array::*}
- add 10 to {Timer.Array::*}
- add 15 to {Timer.Array::*}
- add 20 to {Timer.Array::*}
- add 30 to {Timer.Array::*}
- add 45 to {Timer.Array::*}
- add 60 to {Timer.Array::*}
- add 75 to {Timer.Array::*}
- add 90 to {Timer.Array::*}
- add 120 to {Timer.Array::*}
- add 150 to {Timer.Array::*}
- add 180 to {Timer.Array::*}
- message "{@TimerOP} Successfully reset the broadcast array!"
- command /timer-array-add <integer>:
- description: Add a mark to the broadcast array
- usage: /timer-array-add <mark>
- permission: skript.timer.array.add
- trigger:
- loop {Timer.Array::*}:
- loop-value is equal to arg 1
- message "{@TimerOP} This mark is already in the broadcast array!"
- stop trigger
- add arg 1 to {Timer.Array::*}
- message "{@TimerOP} Added mark &9%arg 1% &rto the broadcast array!"
- command /timer-array-remove <integer>:
- description: Remove a mark from the broadcast array
- usage: /timer-array-remove <mark>
- permission: skript.timer.array.remove
- trigger:
- loop {Timer.Array::*}:
- loop-value is equal to arg 1
- remove arg 1 from {Timer.Array::*}
- message "{@TimerOP} Removed mark &e%arg 1% &rfrom the broadcast array!"
- stop trigger
- message "{@TimerOP} Mark &e%arg 1% &ris not in the broadcast array!"
- command /timer-array-show:
- description: Shows the broadcast array
- usage: /timer-array-show
- permission: skript.timer.array.show
- trigger:
- message "{@TimerOP} The current broadcast array is:"
- message "&r%{Timer.Array::*}%"
- command /timeleft:
- description: Shows how many minutes are left
- aliases: /timefleft
- usage: /timeleft
- trigger:
- if {Timer.Running} is not set:
- message "{@TimerBC} The timer is not running!"
- stop trigger
- message "{@TimerBC} &e%{Timer.MeetupAt}-{Timer.MinutesPassed}% &rminutes remain until Meetup!"
- if {Timer.PvPCheck} is true:
- message "{@TimerBC} &e%{Timer.PvPAt}-{Timer.MinutesPassed}% &rminutes remain until PvP!"
- command /timer-tmole:
- description: Toggle Mole status for the timer
- usage: /timer-tmole
- permission: skript.timer.tmole
- trigger:
- if {Timer.Mole} is not set:
- set {Timer.Mole} to true
- message "{@TimerOP} The Timer is now running in Mole Mode" to command sender
- stop trigger
- if {Timer.Mole} is true:
- delete {Timer.Mole}
- message "{@TimerOP} The Timer is no longer running in Mole Mode" to command sender
- stop trigger
- every {@CheckFrequency} ticks:
- {Timer.Running} is true
- {Timer.Paused} is not set
- if {Timer.MinutesPassed} is not equal to 0:
- set {_TimeSpan} to ("%{Timer.MinutesPassed}+1% minutes" parsed as timespan)
- if {Timer.MinutesPassed} is equal to 0:
- set {_TimeSpan} to ("%{Timer.MinutesPassed}+1% minute" parsed as timespan)
- difference between {Timer.StartTime} and now is more than {_TimeSpan}:
- set {Timer.MinutesPassed} to {Timer.MinutesPassed}+1
- if {Timer.MinutesPassed} is equal to {Timer.MeetupAt}:
- delete {Timer.Running}
- delete {Timer.StartTime}
- delete {Timer.MinutesPassed}
- delete {Timer.MeetupAt}
- delete {Timer.PvPCheck}
- delete {Timer.PvPAt}
- delete {Timer.PauseTime}
- if {@UseInternalCommands} is true:
- execute console command "/timer-meetup"
- if {@UseInternalCommands} is false:
- execute console command "/meetup"
- stop trigger
- set {_RemainingMinutes} to {Timer.MeetupAt}-{Timer.MinutesPassed}
- loop {Timer.Array::*}:
- if loop-value is equal to {_RemainingMinutes}:
- if {_RemainingMinutes} is not equal to 1:
- broadcast "{@TimerBC} Meetup is in &e%{_RemainingMinutes}%&r minutes!"
- execute console command "/cMotd Game in progress! (Around &e%{_RemainingMinutes}%m&f left!)"
- if {_RemainingMinutes} is equal to 1:
- broadcast "{@TimerBC} Meetup is in &e%{_RemainingMinutes}% &rminute!"
- broadcast "{@TimerBC} &rPack your stuff! &rPrepare your journey to &e0,0!"
- exit 2 sections
- if {Timer.PvPCheck} is true:
- if {Timer.MinutesPassed} is equal to {Timer.PvPAt}:
- delete {Timer.PvPCheck}
- delete {Timer.PvPAt}
- if {@UseInternalCommands} is true:
- execute console command "/timer-enablepvp"
- if {@UseInternalCommands} is false:
- execute console command "/enablepvp"
- if {Timer.Mole} is true:
- execute console command "/moles set"
- stop trigger
- if {Timer.Mole} is true:
- loop 5 times:
- if {Timer.MinutesPassed} is equal to ({Timer.PvPAt}-(loop-number)):
- if loop-number is not equal to 1:
- broadcast "{@TimerBC} &cPvP&r/&cMoles &rin &c%loop-number% &rminutes!"
- if loop-number is equal to 1:
- broadcast "{@TimerBC} &cPvP&r/&cMoles &rin &c%loop-number% &rminute!"
- if {@UseInternalCommands} is true:
- execute console command "/timer-aps note.bass"
- if {@UseInternalCommands} is false:
- execute console command "/aps note.bass"
- if {Timer.Mole} is not set:
- loop 5 times:
- if {Timer.MinutesPassed} is equal to ({Timer.PvPAt}-(loop-number)):
- if loop-number is not equal to 1:
- broadcast "{@TimerBC} PvP is on in &e%loop-number% &rminutes!"
- if loop-number is equal to 1:
- broadcast "{@TimerBC} PvP is on in &e&l%loop-number% &r&lminute!"
- if loop-number is equal to 3:
- broadcast "{@TimerBC} Stalking before PvP is allowed!"
- if {@UseInternalCommands} is true:
- execute console command "/sall note.bass 2"
- if {@UseInternalCommands} is false:
- execute console command "/sall note.bass 2"
- command /timer-meetup:
- description: Internal Timer command for Meetup
- usage: /timer-meetup
- permission: skript.timer.meetup
- trigger:
- broadcast "{@TimerBC} &eMEETUP TIME&r!&r Immediately head towards &l0,0!"
- broadcast "{@TimerBC} Stop farming apples! &rLeave your caves!"
- broadcast "{@TimerBC} The &eonly&r excuse for staying in an area is a fight!"
- loop 4 times:
- execute console command "/sall fireworks.launch 1"
- wait 0.05 seconds
- loop 10 times:
- execute console command "/sall note.bass 1"
- wait 0.1 second
- execute console command "/sall fireworks.largeBlast 1"
- command /timer-enablepvp:
- description: Internal Timer command for enabling PvP
- usage: /timer-enablepvp
- permission: skript.timer.enablepvp
- trigger:
- broadcast "{@TimerBC} &rPvP is ON!"
- loop 4 times:
- execute console command "/sall fireworks.launch 1"
- wait 0.05 seconds
- loop 10 times:
- execute console command "/sall note.bass 1"
- wait 0.1 second
- execute console command "/sall fireworks.largeBlast 1"
- execute console command "/pvptoggle world on"
- command /timer-aps <text>:
- description: Internal Timer command to play a sound to everybody
- usage: /timer-aps <sound>
- permission: skript.timer.aps
- trigger:
- loop all players:
- execute console command "/playsound %arg 1% %loop-player%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement