Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- ActionBars: true #Enable/disable action bars!#
- CountdownStart: &7A countdown has begun! #The message that is sent when a countdown begins.#
- CountdownMsg: &7{TIME} #This is the format of time that will be sent in a countdown time message.#
- CountdownEnd: &7The countdown has ended! #This message will be sent when a countdown ends.#
- NoTimeSet: &7Please specify some seconds. #This is sent if a user does not enter a valid time input when creating a countdown.#
- NoPermMsg: &7No Permission! #This is sent if a user does NOT have permission for a command.#
- Prefix: &8[&6Countdown&8] &7 #This is the prefix of the Script.#
- Permission: countdowncommand.use #This is the permission of the Script command.#
- Titles: true #Set to true to enable Titles (BETA!)#
- TopTitleLine: &cNotice! #Set the top line of a title to something!#
- UpdaterPermission: countdowncommand.updater #Permission to use the /countdownupdater command!#
- #---------------------------#
- # NOTICE! #
- # ^^^^ ^^^^ #
- # IF YOU DO NOT KNOW WHAT #
- # YOU ARE DOING THEN DO NOT #
- # EDIT THE SKRIPT BEYOND #
- # THIS POINT! #
- #---------------------------#
- function updateChecker(n: number):
- set {_cdver} to line 1 from url "https://api.spigotmc.org/legacy/update.php?resource=25402/" parsed as a number
- set {_cdv} to "%{cdversion}%" parsed as a number
- if {_cdver} is equal to {_cdv}:
- message "&8[&6Countdown&8] &7Successfully loaded the latest version of &6Countdown &8v&a%{cdversion}%&7." to console
- else if {_cdv} is greater than {_cdver}:
- send "&8[&6Countdown&8] &7Either you're running a beta version or you changed the version number! (&8v&a%{cdversion}%&7)" to console
- else:
- send "&8[&6Countdown&8] &7An update is available! (&a%{_cdv}% &7-> &a%{_cdver}%&7)" to console
- send "&8[&6Countdown&8] &7Download it here: &fhttp://bit.ly/2kFm4jN" to console
- function updateCheckerCmd(p: player):
- set {_cdver} to line 1 from url "https://api.spigotmc.org/legacy/update.php?resource=25402/" parsed as a number
- set {_cdv} to "%{cdversion}%" parsed as a number
- if {_cdver} is equal to {_cdv}:
- send "&8[&6Countdown&8] &7You are currently running the latest version of &6Countdown &8v&a%{cdversion}%&7." to {_p}
- else if {_cdv} is greater than {_cdver}:
- send "&8[&6Countdown&8] &7Either you're running a beta version or you changed the version number! (&8v&a%{cdversion}%&7)" to {_p}
- else:
- send "&8[&6Countdown&8] &7An update is available! (&a%{_cdv}% &7-> &a%{_cdver}%&7)" to {_p}
- send "&8[&6Countdown&8] &7Download it here: &fhttp://bit.ly/2kFm4jN" to {_p}
- function countDown(t: integer, p: player, g: text):
- set {_m} to "{@CountdownMsg}"
- set {cmd} to {_g}
- loop {_t} times:
- if {timer} is true:
- if {@Titles} is true:
- send all players title "{@TopTitleLine}" with subtitle "%{_t}%" for 1 seconds
- if {@ActionBars} is true:
- set action bar of {_p} to "&6Countdown: &7%{_t}%"
- wait 1 seconds
- remove 1 from {_t}
- set {cd} to {_t}
- broadcast "{@Prefix}%{_t}%"
- if {_t} = 0:
- delete {cd}
- if {_g} is set:
- execute console command {_g}
- delete {cmd}
- broadcast "{@Prefix}{@CountdownEnd}"
- command /countdown [<integer>] [<text>]:
- permission message: {@NoPermMsg}
- permission: {@Permission}
- trigger:
- if arg 1 is set:
- if arg 1 is "0" parsed as an integer:
- if {timer} is true:
- set {timer} to false
- send "{@Prefix}Stopped the countdown"
- else:
- send "{@Prefix}There is no timer running."
- else:
- broadcast "{@Prefix}{@CountdownStart}"
- wait 1 seconds
- set {_time} to arg 1
- countDown(arg 1, {_p}, arg 2)
- set {timer} to true
- else if arg 1 is not set:
- send "{@Prefix}{@NoTimeSet}"
- command /countdownupdater [<text>]:
- permission message: {@NoPermMsg}
- permission: {@UpdaterPermission}
- trigger:
- if arg 1 is set:
- if arg 1 is "toggle":
- if {cdupdater} is true:
- set {cdupdater} to false
- send "{@Prefix}Successfully set the auto update checker to false."
- else:
- set {cdupdater} to true
- send "{@Prefix}Successfully set the auto update checker to true."
- else if arg 1 is "check":
- updateCheckerCmd(player)
- else:
- send "{@Prefix}Unknown argument."
- else:
- send "{@Prefix}Please use one of the following arguments: toggle, check"
- on skript load:
- updateChecker(1)
- every 5 minutes:
- if {cdupdater} is true:
- updateChecker(1)
- on load:
- set {cdversion} to "2.5"
- message "&8[&6Countdown&8] &7Successfully loaded &6Countdown Command&7." to console
- on skript load:
- countDown({cd}, {_p}, {cmd})
- on unload:
- message "&8[&6Countdown&8] &7Successfully unloaded &6Countdown Command&7. Goodbye!" to console
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement