Files
rtp.sk
Code
1 58
rtp.sk
# OrionRTPX - Clean & Lag-Free Random Teleport
# Simple, efficient RTP system
options:
prefix: &b&lOrionRTPX &8>> &7
min-distance: 5000
max-distance: 7500
cooldown: 5
# Cooldown storage
variables:
{rtp.cooldown::*} = 0
command /rtp:
permission: rtp.use
permission message: &cYou don't have permission to use this command.
aliases: /wild, /randomtp
trigger:
# Check cooldown
if {rtp.cooldown::%player%} is set:
if difference between {rtp.cooldown::%player%} and now is less than {@cooldown} seconds:
if player doesn't have permission "rtp.bypass":
set {_remaining} to {@cooldown} - difference between {rtp.cooldown::%player%} and now
send "{@prefix}&cCooldown: &e%{_remaining}% seconds" to player
stop
# Get random location
set {_x} to random integer between {@min-distance} and {@max-distance}
set {_z} to random integer between {@min-distance} and {@max-distance}
# Randomize direction
set {_rand} to random integer between 1 and 2
if {_rand} is 1:
set {_x} to {_x} * -1
set {_rand} to random integer between 1 and 2
if {_rand} is 1:
set {_z} to {_z} * -1
# Get safe location
set {_world} to world of player
set {_y} to 100
set {_loc} to location at {_x}, {_y}, {_z} in {_world}
set {_safe} to highest block at {_loc}
add 1 to y-coordinate of {_safe}
# Teleport
teleport player to {_safe}
send "{@prefix}&aTeleported to random location!" to player
play sound "entity.enderman.teleport" to player
# Set cooldown
set {rtp.cooldown::%player%} to now
command /rtp reload:
permission: rtp.admin
trigger:
send "{@prefix}&aConfiguration reloaded!" to player