-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
rtp.sk
42 lines (38 loc) · 1.83 KB
/
rtp.sk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
options:
Minimum-x: -500 #Minimum x of randomtp
Maximum-x: 500 #Maximum x of randomtp
Minimum-z: -500 #Minimum z of randomtp
Maximum-z: 500 #Maximum x of randomtp
cooldown: 5 seconds #formated as (Amount of time) (Seconds, Minutes, days ect...)
avoid: water or lava #Avoid spawning formated as (Block) or (Block) ect...
worlds: "world" #worlds formated as "(World name)" or "(World name)" or "(World name)" ect...
Permission: randomtp.use #Permission
PermissionMessage: &cYou do not have permission to use this command! #No permission message
CommandIsNotExecuteableInWorld: &cYou can’t use this command in this world! #Can not execute command in this world message
CooldownMessage: &CYou have to wait another %{_cooldown}% &cbefore you can execute this command again! #Cooldown message %{_cooldown}% is the time until the command is executeable again)
command /randomtp:
aliases: rtp, wild, rteleport, randomteleport
permission: {@Permission}
Permission Message: {@PermissionMessage}
trigger:
if world is not {@worlds}:
send "{@CommandIsNotExecuteableInWorld}"
else:
if difference between {randomtp::%player%} and now is less than {@cooldown}:
set {_cooldown} to {@cooldown}
remove difference between {randomtp::%player%} and now from {_cooldown}
send "{@CooldownMessage}"
else:
set {_Randomtp.avoid} to 0
while {_Randomtp.avoid} is equal to 0:
wait 1 tick
set {_loc} to location at random number between {@Minimum-x} and {@Maximum-x}, 255, random number between {@Maximum-z} and {@Minimum-z}
while block at {_loc} is air:
remove 1 from y-coordinate of {_loc}
loop all blocks in radius 1 of {_loc}:
if loop-block is not {@avoid}:
add 1 to y-coordinate of {_loc}
set {_Randomtp.avoid} to 1
teleport player to {_loc}
set {randomtp::%player%} to now
stop