variables: {nRtp::settings::prefix} = "&8[&9N&bRTP&8]" {nRtp::settings::permissionMessage} = "&cNie masz permisji do tej komendy!" {nRtp::settings::odlegloscX} = 5000 {nRtp::settings::odlegloscZ} = 5000 {nRtp::settings::cooldown} = 5 seconds {nRtp::settings::cooldownMessage} = "&cTrwa cooldown, poczekaj." command /rtp []: aliases: nrtp, nrandomteleport trigger: if arg 1 is "admin" or "settings": if player has permission "nrtp.admin": openRtpSettings(player) else: send "%{nRtp::settings::prefix}% %{nRtp::settings::permissionMessage}%" else: if difference between {nRtp::cooldown::%player%} and now is less than {nRtp::settings::cooldown}: send "%{nRtp::settings::prefix}% %{nRtp::settings::cooldownMessage}%" stop randomTp(player) set {nRtp::cooldown::%player%} to now function randomTp(player: player): set {_newLoc} to searchForLocation() teleport {_player} to {_newLoc} send "%{nRtp::settings::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::settings::odlegloscX} and {nRtp::settings::odlegloscX} * -1 set {_y} to 256 set {_z} to random integer between {nRtp::settings::odlegloscZ} and {nRtp::settings::odlegloscZ} * -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::settings::prefix}%" set slot 15 of {_rtpGui} to barrier block named "&bBrak permisji" with lore "&7Ustawia wiadomość" and "&7o braku permisji." and "&7Aktualnie: %{nRtp::settings::permissionMessage}%" set slot 13 of {_rtpGui} to clock named "&bCooldown" with lore "&7Ustawia czas, który gracz musi" and "&7odczekać by użyć rtp ponownie." and "&7Aktualnie: %{nRtp::settings::cooldown}%" set slot 29 of {_rtpGui} to repeater named "&bTrwający cooldown" with lore "&7Ustawia wiadomość" and "&7o trwającym cooldownie." and "&7Aktualnie: %{nRtp::settings::cooldownMessage}%" set slot 31 of {_rtpGui} to compass named "&bOdległość X" with lore "&7Ustawia odległość X, która nie będzie mogła" and "&7zostać przekroczona przy szukaniu lokalizacji." and "&7Aktualnie: %{nRtp::settings::odlegloscX}%" set slot 33 of {_rtpGui} to compass named "&bOdległość Z" with lore "&7Ustawia odległość Z, która nie będzie mogła" and "&7zostać przekroczona przy szukaniu lokalizacji." and "&7Aktualnie: %{nRtp::settings::odlegloscZ}%" 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::settings::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::settings::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::settings::prefix}% &aNapisz na chacie w sekundach, jaki chcesz ustawić cooldown." else if clicked slot is 29: set {nRtp::cooldownMesChanging::%player%} to true close player's inventory send "%{nRtp::settings::prefix}% &aNapisz na chacie, jaką chcesz mieć wiadomość o trwającym cooldownie." else if clicked slot is 31: set {nRtp::distanceXChanging::%player%} to true close player's inventory send "%{nRtp::settings::prefix}% &aNapisz na chacie, jaką chcesz mieć odległość X." else if clicked slot is 33: set {nRtp::distanceZChanging::%player%} to true close player's inventory send "%{nRtp::settings::prefix}% &aNapisz na chacie, jaką chcesz mieć odległość Z." on chat: if {nRtp::prefixChanging::%player%} is true: cancel event set {nRtp::settings::prefix} to message set {nRtp::prefixChanging::%player%} to false openRtpSettings(player) else if {nRtp::permsMesChanging::%player%} is true: cancel event set {nRtp::settings::permissionMessage} to message 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 {nRtp::settings::cooldown} to "%message% seconds" parsed as timespan else: send "%{nRtp::prefix}% &cTo nie liczba! Musisz wpisać czas w sekundach, na przykład ""5""." set {nRtp::cooldownChanging::%player%} to false openRtpSettings(player) else if {nRtp::distanceXChanging::%player%} is true: cancel event if message parsed as number is set: set {nRtp::settings::odlegloscX} to message else: send "%{nRtp::prefix}% &cTo nie liczba! Musisz wpisać odległość w blokach, na przykład ""5000""." set {nRtp::distanceXChanging::%player%} to false openRtpSettings(player) else if {nRtp::distanceZChanging::%player%} is true: cancel event if message parsed as number is set: set {nRtp::settings::odlegloscZ} to message else: send "%{nRtp::prefix}% &cTo nie liczba! Musisz wpisać odległość w blokach, na przykład ""5000""." set {nRtp::distanceZChanging::%player%} to false openRtpSettings(player) else if {nRtp::cooldownMesChanging::%player%} is true: cancel event set {nRtp::settings::cooldownMessage} to message set {nRtp::cooldownMesChanging::%player%} to false openRtpSettings(player)