Paste #19844: Edit of P#19843 - Edit of P#19842 - Edit of P#19841 - Untitled Paste

Date: 2015/09/04 07:47:28 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


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
      }