options: allRTP: minX: -5000 maxX: 5000 minZ: -5000 maxZ: 5000 fromWorld: world or word2 or world_the_end or world_nether countdown: 5 normalRTP: toWorld: world2 endRTP: toWorld: world_the_end opened: from: 12 to: 16 netherRTP: toWorld: world_nether minY: 20 maxY: 100 opened: from: 18 to: 22 prefix: "&f[&a&lR&c&lT&e&lP&r&f]&r " local function randomSafeLocation(minX: number, maxX: number, minZ: number, maxZ: number, w: world, nether: boolean = false) :: location: set {_foundLocation} to false if {_nether} is true: while {_foundLocation} is false: set {_x} to random integer between {_minX} and {_maxX} set {_y} to {@netherRTP.minY} set {_z} to random integer between {_minZ} and {_maxZ} loop ({@netherRTP.maxY} - {@netherRTP.minY} + 1) times: set {_returnBlock} to block at location({_x}, {_y}, {_z}, {_w}) if: block under {_returnBlock} is not lava or air or water {_returnBlock} is not lava or water block above {_returnBlock} is not lava or water then: set {_foundLocation} to true exit loop add 1 to {_y} else: while {_foundLocation} is false: set {_x} to random integer between {_minX} and {_maxX} set {_y} to 0 set {_z} to random integer between {_minZ} and {_maxZ} set {_highestBlock} to highest block at location({_x}, {_y}, {_z}, {_w}) {_highestBlock} is not water or lava set {_returnBlock} to block above {_highestBlock} {_returnBlock} is not water or lava block above {_returnBlock} is not water or lava set {_foundLocation} to true return location of {_returnBlock} command /rtp []: executable by: players trigger: set {_diff} to difference between {RTP::lastTeleport::%player's uuid%} and now if {_diff} isn't less than 15 seconds: if player isn't in world "{@allRTP.fromWorld}": send "&6Możesz wykonać tę komendę jedynie w świecie &e{@allRTP.fromWorld}&6." to player stop set {_hour} to (now formatted as "HH") parsed as integer if arg is "overworld": set {_locationRTP} to randomSafeLocation({@allRTP.minX}, {@allRTP.maxX}, {@allRTP.minZ}, {@allRTP.maxZ}, world "{@normalRTP.toWorld}") set {_message} to "%{@prefix}%&aZostałeś przeteleportowany do świata &b{@normalRTP.toWorld}&a." else if arg is "end": if {_hour} isn't between {@endRTP.opened.from} and ({@endRTP.opened.to} - 1): send "&dEnd &6jest aktywny od &e{@endRTP.opened.from}:00 &6do &e{@endRTP.opened.to}:00&6." to player stop set {_locationRTP} to randomSafeLocation({@allRTP.minX}, {@allRTP.maxX}, {@allRTP.minZ}, {@allRTP.maxZ}, world "{@endRTP.toWorld}") set {_message} to "%{@prefix}%&aZostałeś przeteleportowany do &dEndu&a." else if arg is "nether": if {_hour} isn't between {@netherRTP.opened.from} and ({@netherRTP.opened.to} - 1): send "&cNether &6jest aktywny od &e{@netherRTP.opened.from}:00 &6do &e{@netherRTP.opened.to}:00&6." to player stop set {_locationRTP} to randomSafeLocation({@allRTP.minX}, {@allRTP.maxX}, {@allRTP.minZ}, {@allRTP.maxZ}, world "{@netherRTP.toWorld}", true) set {_message} to "%{@prefix}%&aZostałeś przeteleportowany do &cNetheru&a." else: send "%{@prefix}%&cPoprawne użycie: /rtp [(overworld|nether|end)]" to player stop if {RTP::isTeleporting::%player's uuid%} is set: stop set {RTP::isTeleporting::%player's uuid%} to true set {tpChecker.%player's uuid%} to true set {_seconds} to {@allRTP.countdown} send "%{@prefix}%&aZostaniesz teleportowany za &e%{_seconds}% sekund &c&lNie Ruszaj się!" to player loop {@allRTP.countdown} times: if {tpChecker.%player's uuid%} is true: # send title "&9%{@allRTP.countdown} - loop-number + 1%&3..." to player remove 1 from {_seconds} wait 1 seconds else: send "%{@prefix}%&cPoruszyłeś się!" to player clear {RTP::isTeleporting::%player's uuid%} stop teleport player to {_locationRTP} set {RTP::lastTeleport::%player's uuid%} to now clear {RTP::isTeleporting::%player's uuid%} delete {tpChecker.%player's uuid%} send {_message} to player else: set {_remaining} to difference between {_diff} and 15 seconds send "%{@prefix}%&cNastępnej teleportacji możesz użyć za: &f%{_remaining}%!" to player # ########################################################### on disconnect: delete {tpChecker.%player's uuid%} clear {RTP::isTeleporting::%player's uuid%} # ########################################################### on quit: delete {tpChecker.%player's uuid%} clear {RTP::isTeleporting::%player's uuid%} # ########################################################### on player walk: if {tpChecker.%player's uuid%} is true: delete {tpChecker.%player's uuid%} # ########################################################### on script unload: clear {RTP::isTeleporting::*}