Date: 2015/09/04 07:47:28 UTC-07:00
Type: Denizen Script
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
43
44
RandomTeleporterCommand:
type: command
debug: false
name: randomtp
aliases:
- rtp
script:
- if !<player.is_op> queue clear
- inject RandomTeleport
- teleport <player> <def[location].highest.add[0,1.5,0]>
RandomTeleport:
type: task
debug: true
script:
- ^define location <w@svet.spawn_location>
- ^define x <util.random.int[500].to[2000]>
- ^if <util.random.int[1].to[2].is[==].to[1]> {
- define x <def[x].mul[-1]>
}
- ^define z <util.random.int[500].to[2000]>
- ^if <util.random.int[1].to[2].is[==].to[1]> {
- define z <def[z].mul[-1]>
}
- ^define top <def[location].add[<def[x]>,0,<def[z]>].highest>
- announce "%top%" to_console
- ^if <li@water|lava|cactus.contains[<def[top].material.name>]> {
- inject RandomTeleport instantly
}
RandomTeleportSign:
type: world
debug: false
events:
on player clicks wall_sign:
- if <c.location.sign_contents.get[1].is[==].to[<&1><&lb>RandomTP<&rb>]> {
- if <player.has_flag[RTP_cooldown]> {
- narrate "[<&3>NomBlox<&r>] <&c>RandomTP is on cooldown!"
- narrate "[<&3>NomBlox<&r>] <&c>Remaining time: <player.flag[RTP_cooldown].duration>!"
} else {
- ^inject RandomTeleport instantly
- ^teleport <player> <def[location].highest.add[0,1,0]>
- execute as_op unstuck
}