# _____ _ _______ _____ _ # | __ \ | | |__ __| / ____| | # __ _| |__) |__ _ _ __ __| | ___ _ __ ___ | |_ __| (___ | | __ # \ \/ / _ // _` | '_ \ / _` |/ _ \| '_ ` _ \| | '_ \\___ \| |/ / # > <| | \ \ (_| | | | | (_| | (_) | | | | | | | |_) |___) | < # /_/\_\_| \_\__,_|_| |_|\__,_|\___/|_| |_| |_|_| .__/_____/|_|\_\ # | | # |_| # Author: GlobooX (MinecraftPolska.Net) # Version: 1.0 # # Można używać i edytować na własne potrzeby. # Proszę jedynie o to aby nikt nie publikował tego jako własnego skryptu! # options: config: plugins/xRandomTpSk/config.yml prefixdb: xtp_ logo: &3[&exRanTp&3] on load: if folder "plugins/xRandomTpSk" doesn't exists: send "&e[&cERROR&e] &fFolder doesn't exists, creating folder 'xRandomTpSk'..." to console create folder "plugins/xRandomTpSk" send " &fFolder 'plugins/xRandomTpSk' has ben created!" to console if file "plugins/xRandomTpSk/config.yml" doesn't exists: send "&e[&cERROR&e] &fConfig file doesn't exists, creating file 'config.yml'..." to console send " &fFile 'plugins/xRandomTpSk/config.yml' has ben created!" to console create file "plugins/xRandomTpSk/config.yml" stop command xrandomtp []: permission: xrandomtp.use aliases: xtp, xrantp, randomtp, rtp trigger: if arg 1 is not "button" or "buttonlist" or "author" or "purge" or "addloc" or "resetloc" or "loclist": set {_admin-lang.unknown-cmd} to coloured single value "admin-lang.unknown-cmd" get of "{@config}" replace all "_NL_" with "%nl%" in {_admin-lang.unknown-cmd} send "{@logo} %{_admin-lang.unknown-cmd}%" if arg 1 is not set: send "&c&l&m-------------&r&c&l[ &3&lxRandomTp &c&l]&c&l&m-------------" send "&e/xtp &a- &7pokazuje to menu pomocy" send "&e/xtp button &a- &7przyznaje przycisk teleportacji" send "&e/xtp addloc &a- &7dodanie lokacji do listy (tp mode 'list')" send "&e/xtp resetloc &a- &7usuwa wszystkie lokacje teleportacji" send "&e/xtp loclist &a- &7wyswietla liste teleportacji przyciskow" send "&e/xtp buttonlist &a- &7wyswietla liste postawionych przyciskow" send "&e/xtp purge &a- &7dezaktywuje wszystkie przyciski" send "&e/xtp author &a- &7wyswietla info o autorze" # Argument BUTTON, przyznawanie przycisku if arg is "button": remove all stone button named "&b&m-&r&b[ &exRandomTp &b]&b&m-" from the player give 1 stone button named "&b&m-&r&b[ &exRandomTp &b]&b&m-" to the player set {_admin-lang.give-button} to coloured single value "admin-lang.give-button" get of "{@config}" replace all "_NL_" with "%nl%" in {_admin-lang.give-button} send "{@logo} %{_admin-lang.give-button}%" # Argument PURGE, usuwanie wszystkich przyciskow if arg 1 is "purge": clear {{@prefixdb}xrandomtp.list::*} set {_admin-lang.clear-buttons} to coloured single value "admin-lang.clear-buttons" get of "{@config}" replace all "_NL_" with "%nl%" in {_admin-lang.clear-buttons} send "{@logo} %{_admin-lang.clear-buttons}%" # Argument ADDLOC, dodawanie lokacji do listy if arg 1 is "addloc": spawn 20 of particle CLOUD offset by 0.5, 1.5, 0.5 at player add location of the player to {{@prefixdb}xrandomtp.teleport.list::*} send "{@logo} &aDodano lokacje &3%location of the player% &ado listy!" # Argument RESETLOC, usuwanie wszystkich lokacji teleportacji if arg 1 is "resetloc": clear {{@prefixdb}xrandomtp.teleport.list::*} set {_admin-lang.clear-locations} to coloured single value "admin-lang.clear-locations" get of "{@config}" replace all "_NL_" with "%nl%" in {_admin-lang.clear-locations} send "{@logo} %{_admin-lang.clear-locations}%" # Argument BUTTONLIST, wyswietlanie wszystkich aktywnych przyciskow teleportacji if arg 1 is "buttonlist": send "&c&l&m-------------&r&c&l[ &3&lxRandomTp &c&l]&c&l&m-------------" if {{@prefixdb}xrandomtp.list::*} is not set: send " &7Brak aktywnych przyciskow do losowej teleportacji!" stop loop {{@prefixdb}xrandomtp.list::*}: send json of "&c✘" tooltip "&cKliknij aby usunac!" run "/xrandomtp_delete button %loop-value%" then " &bPrzycisk %loop-index% &a-> &7%loop-value%" to player # Argument LOCLIST, wyswietlanie wszystkich lokacji teleportacji if arg 1 is "loclist": send "&c&l&m-------------&r&c&l[ &3&lxRandomTp &c&l]&c&l&m-------------" if {{@prefixdb}xrandomtp.teleport.list::*} is not set: send " &7Brak aktywnych lokacji do losowej teleportacji!" stop loop {{@prefixdb}xrandomtp.teleport.list::*}: send json of "&c✘" tooltip "&cKliknij aby usunac!" run "/xrandomtp_delete location %loop-value%" then " &bLokacja %loop-index% &a-> &7%loop-value%" to player # Argument AUTHOR, wyswietlanie informacji o autorze if arg 1 is "author": send "" send "&c&l&m-------------&r&c&l[ &3&lxRandomTp &c&l]&c&l&m-------------" send "" send " &eAutorem skryptu jest &bGlobooX" send " &awww.MinecraftPolska.Net" send "" send " &7Tej wiadomosci zapewne nie zobaczy nikt" send " &7poniewaz wszyscy usuna wzmianke o autorze :)" # Komenda do interaktywnego kasowania lokacji i przyciskow command /xrandomtp_delete [] []: permission: xrandomtp.deleteloc trigger: if arg 1 is "button": loop {{@prefixdb}xrandomtp.list::*}: if "%loop-value%" is the same as "%arg 2%": remove loop-value from {{@prefixdb}xrandomtp.list::*} send "" send "" make player execute command "xrandomtp buttonlist" if arg 1 is "location": loop {{@prefixdb}xrandomtp.teleport.list::*}: if "%loop-value%" is the same as "%arg 2%": remove loop-value from {{@prefixdb}xrandomtp.teleport.list::*} send "" send "" make player execute command "xrandomtp loclist" on place a stone button: if name of player's tool is "&b&m-&r&b[ &exRandomTp &b]&b&m-": send "{@logo} &aAktywowano &7przycisk losowej teleportacji!" spawn 20 of particle SLIME offset by 0.5, 0.5, 0.5 at event-location add location of event-block to {{@prefixdb}xrandomtp.list::*} on break of stone button: loop {{@prefixdb}xrandomtp.list::*}: if location of event-block is the same as loop-value: send "{@logo} &cDezaktywowano &7przycisk losowej teleportacji!" spawn 20 of particle CLOUD offset by 0.5, 0.5, 0.5 at event-location remove location of event-block from {{@prefixdb}xrandomtp.list::*} on rightclick on button: loop {{@prefixdb}xrandomtp.list::*}: if location of event-block is the same as loop-value: set {_xrandomtp.wait-time} to single value "wait-time" get of "{@config}" set {_xrandomtp.wait-time} to "%{_xrandomtp.wait-time}% seconds" parsed as timespan set {_temp.wait} to difference between {xrandomtp.%player%.lastused} and now if {_temp.wait} is less than {_xrandomtp.wait-time}: set {_lang.teleport-wait} to coloured single value "lang.teleport-wait" get of "{@config}" replace all "_PLAYER_" with "%player%" in {_lang.teleport-wait} send "{@logo} %{_lang.teleport-wait}%" cancel event else: set {_xrandomtp.teleport-time} to single value "teleport-time" get of "{@config}" set {_lang.teleport-wait-msg} to coloured single value "lang.teleport-wait-msg" get of "{@config}" replace all "_PLAYER_" with "%player%" in {_lang.teleport-wait-msg} replace all "_TIME-TP_" with "%{_xrandomtp.teleport-time}%" in {_lang.teleport-wait-msg} send "{@logo} %{_lang.teleport-wait-msg}%" set {_xrandomtp.teleport-time} to "%{_xrandomtp.teleport-time}% second" parsed as timespan wait {_xrandomtp.teleport-time} set {_xrandomtp.itemslist.temp::*} to value list "items" get of "{@config}" loop {_xrandomtp.itemslist.temp::*}: add loop-value-2 split at " " to {_xrandomtp.itemslist.%loop-index-2%.%loop-value-2%::*} set {_xrandomtp.item.%loop-index-2%.%loop-value-2%.1} to "%{_xrandomtp.itemslist.%loop-index-2%.%loop-value-2%::2}% %{_xrandomtp.itemslist.%loop-index-2%.%loop-value-2%::1}%" parsed as item set {_xrandomtp.item.%loop-index-2%.%loop-value-2%.3} to coloured {_xrandomtp.itemslist.%loop-index-2%.%loop-value-2%::3} replace all "_" with " " in {_xrandomtp.item.%loop-index-2%.%loop-value-2%.3} if {_xrandomtp.item.%loop-index-2%.%loop-value-2%.3} is set: give {_xrandomtp.item.%loop-index-2%.%loop-value-2%.1} named "%{_xrandomtp.item.%loop-index-2%.%loop-value-2%.3}%" to player else: give {_xrandomtp.item.%loop-index-2%.%loop-value-2%.1} to player set {_xrandomtp.effectlist.temp::*} to value list "effect" get of "{@config}" loop {_xrandomtp.effectlist.temp::*}: add loop-value-2 split at " " to {_xrandomtp.effectlist.%loop-index-2%.%loop-value-2%::*} set {_xrandomtp.effect.%loop-index-2%.%loop-value-2%.1} to {_xrandomtp.effectlist.%loop-index-2%.%loop-value-2%::1} parsed as potion effect set {_xrandomtp.effect.%loop-index-2%.%loop-value-2%.2} to {_xrandomtp.effectlist.%loop-index-2%.%loop-value-2%::2} parsed as number set {_xrandomtp.effect.%loop-index-2%.%loop-value-2%.3} to "%{_xrandomtp.effectlist.%loop-index-2%.%loop-value-2%::3}% seconds" parsed as timespan apply potion of {_xrandomtp.effect.%loop-index-2%.%loop-value-2%.1} of tier {_xrandomtp.effect.%loop-index-2%.%loop-value-2%.2} to the player for {_xrandomtp.effect.%loop-index-2%.%loop-value-2%.3} set {_xrandomtp.mode} to single value "mode" get of "{@config}" if {_xrandomtp.mode} is "random": set {_x-min.config} to single value "radius.x-min" get of "{@config}" set {_x-max.config} to single value "radius.x-max" get of "{@config}" set {_z-min.config} to single value "radius.z-min" get of "{@config}" set {_z-max.config} to single value "radius.z-max" get of "{@config}" set {_x-min.config} to {_x-min.config} parsed as number set {_x-max.config} to {_x-max.config} parsed as number set {_z-min.config} to {_z-min.config} parsed as number set {_z-max.config} to {_z-max.config} parsed as number set {_coord-x} to a random integer between {_x-min.config} and {_x-max.config} set {_coord-z} to a random integer between {_z-min.config} and {_z-max.config} set {_coord-y} to single value "radius.y-check" get of "{@config}" set {_coord-y} to {_coord-y} parsed as number set {_check.times} to difference between {_coord-y} and 256 loop {_check.times} times: if block at location ({_coord-x}, {_coord-y}, {_coord-z}) is not air: block at location ({_coord-x}, {_coord-y} -1, {_coord-z}) is not air block at location ({_coord-x}, {_coord-y} -2, {_coord-z}) is not air add 1 to {_coord-y} teleport player to location ({_coord-x}, {_coord-y}, {_coord-z}) set {_lang.teleport-random} to coloured single value "lang.teleport-random" get of "{@config}" replace all "_PLAYER_" with "%player%" in {_lang.teleport-random} replace all "_X-COORD_" with "%{_coord-x}%" in {_lang.teleport-random} replace all "_z-COORD_" with "%{_coord-z}%" in {_lang.teleport-random} replace all "_Y-COORD_" with "%{_coord-y}%" in {_lang.teleport-random} send "%{_lang.teleport-random}%" if {_xrandomtp.mode} is "list": if {{@prefixdb}xrandomtp.teleport.list::*} is not set: set {_lang.tp-loc-empty} to coloured single value "lang.tp-loc-empty" get of "{@config}" replace all "_PLAYER_" with "%player%" in {_lang.tp-loc-empty} send "{@logo} %{_lang.tp-loc-empty}%" stop set {_random} to random element out of {{@prefixdb}xrandomtp.teleport.list::*} teleport player to {_random} set {_lang.teleport-list} to coloured single value "lang.teleport-list" get of "{@config}" replace all "_PLAYER_" with "%player%" in {_lang.teleport-list} replace all "_LOCATION_" with "%{_random}%" in {_lang.teleport-list} send "%{_lang.teleport-list}%" set {xrandomtp.%player%.lastused} to now