options: prefix: &8[<##e6f02b>Survival&8] on load: nRtpReload() command /rtp []: trigger: if arg 1 is "admin" or "settings": if player has permission "nrtp.admin": openRtpSettings(player) else: send "%{nRtp::prefix}% %yaml value "brak-permisji" from "nRtpConfig"%" else if arg 1 is "reload": nRtpReload() send "%{nRtp::prefix}% &aPomyślnie przeładowano konfigurację skryptu." else: if difference between {nRtp::cooldown::%player%} and now is less than yaml value "cooldown" from "nRtpConfig": send "{@prefix} %yaml value "cooldown-message" from "nRtpConfig"%" stop randomTp(player) set {nRtp::cooldown::%player%} to now function nRtpReload(): load yaml "plugins/Skript/scripts/NRandomTeleport/config.yml" as "nRtpConfig" if yaml path "prefix" in "nRtpConfig" doesn't exist: set yaml value "prefix" from "nRtpConfig" to "&8[&9N&bRTP&8]" if yaml path "brak-permisji" in "nRtpConfig" doesn't exist: set yaml value "brak-permisji" from "nRtpConfig" to "&cNie masz permisji do tej komendy!" if yaml path "odleglosc-x" in "nRtpConfig" doesn't exist: set yaml value "odleglosc-x" from "nRtpConfig" to 5000 if yaml path "odleglosc-z" in "nRtpConfig" doesn't exist: set yaml value "odleglosc-z" from "nRtpConfig" to 5000 if yaml path "cooldown" in "nRtpConfig" doesn't exist: set yaml value "cooldown" from "nRtpConfig" to 5 seconds if yaml path "cooldown-message" in "nRtpConfig" doesn't exist: set yaml value "cooldown-message" from "nRtpConfig" to "&cNie tak szybko! Po losowej teleportacji musisz poczekać, by wykonać następną." save yaml "nRtpConfig" set {nRtp::prefix} to yaml value "prefix" from "nRtpConfig" set {nRtp::xCords} to yaml value "odleglosc-x" from "nRtpConfig" set {nRtp::zCords} to yaml value "odleglosc-z" from "nRtpConfig" function randomTp(player: player): set {_oldLoc} to {_player}'s location set {_newLoc} to searchForLocation() teleport {_player} to {_newLoc} send "%{nRtp::prefix}% &aZostałeś przeteleportowany do %{_newLoc}'s x-coordinates% %{_newLoc}'s y-coordinates% %{_newLoc}'s z-coordinates%!" to {_player} function randomizeLocation() :: location: set {_x} to random integer between {nRtp::xCords} and {nRtp::xCords} * -1 set {_y} to 256 set {_z} to random integer between {nRtp::zCords} and {nRtp::zCords} * -1 return (location at {_x}, {_y}, {_z} world "world") function searchForLocation() :: location: set {_tp} to highest solid block at randomizeLocation() while block at {_tp} is lava or water: set {_tp} to highest solid block at randomizeLocation() add 1 to y-coordinates of {_tp} return {_tp} function openRtpSettings(p: player): set {_rtpGui} to chest inventory with 6 rows named "&9Ustawienia &9NRTP" set slot 11 of {_rtpGui} to oak sign named "&bPrefix" with lore "&7Ustawia prefix pojawiąjący się" and "&7przed każdą wiadomością." and "&7Aktualnie: %{nRtp::prefix}%" set slot 15 of {_rtpGui} to oak sign named "&bBrak permisji" with lore "&7Ustawia wiadomość" and "&7o braku permisji." and "&7Aktualnie: %yaml value "brak-permisji" from "nRtpConfig"%" set slot 13 of {_rtpGui} to oak sign named "&bCooldown" with lore "&7Ustawia czas, który gracz musi" and "&7odczekać by użyć rtp ponownie." and "&7Aktualnie: %yaml value "cooldown" from "nRtpConfig"%" open {_rtpGui} to {_p} on inventory click: if name of event-inventory is "&9Ustawienia &9NRTP": cancel event event-inventory is not player's inventory if clicked slot is 11: set {nRtp::prefixChanging::%player%} to true close player's inventory send "%{nRtp::prefix}% &aNapisz na chacie, jaki chcesz mieć prefix." else if clicked slot is 15: set {nRtp::permsMesChanging::%player%} to true close player's inventory send "%{nRtp::prefix}% &aNapisz na chacie, jaką chcesz mieć wiadomość o braku permisji." else if clicked slot is 13: set {nRtp::cooldownChanging::%player%} to true close player's inventory send "%{nRtp::prefix}% &aNapisz na chacie w sekundach, jaki chcesz ustawić cooldown." on chat: if {nRtp::prefixChanging::%player%} is true: cancel event set yaml value "prefix" from "nRtpConfig" to message save yaml "nRtpConfig" set {nRtp::prefix} to yaml value "prefix" from "nRtpConfig" set {nRtp::prefixChanging::%player%} to false openRtpSettings(player) else if {nRtp::permsMesChanging::%player%} is true: cancel event set yaml value "brak-permisji" from "nRtpConfig" to message save yaml "nRtpConfig" set {nRtp::permsMesChanging::%player%} to false openRtpSettings(player) else if {nRtp::cooldownChanging::%player%} is true: cancel event if message parsed as number is set: set yaml value "cooldown" from "nRtpConfig" to "%message% seconds" parsed as timespan save yaml "nRtpConfig" else: send "%{nRtp::prefix}% &cTo nie liczba! Musisz wpisać czas w sekundach, na przykład ""5""." set {nRtp::cooldownChanging::%player%} to false openRtpSettings(player) on tab complete of "/rtp": set tab completions for position 1 to "settings" and "reload" if player has permission "nrtp.admin"