Paste #33691: Untitled Paste

Date: 2016/05/24 16:30:29 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


going_to_spawn:
    type: command
    debug: false
    name: Spawn
    usage: /spawn
    description: Sends you to the worlds Spawn Point
#    permission: yeticraft.cmd.spawn
    script:
        - if <context.server> {
            - narrate "<&c>WHOA<&co> <&e>You must be a player in-game to run this command"
            - queue clear
        }
        - if <player.has_flag[spawn_cooldown]> {
            - narrate "<&c>There is a five second cool-down for this command"
            - queue clear
        }
#        - if <player.has_permission[yeticraft.cmd.spawn].not> {
#            - narrate "<&c>You do not have permission to teleport to this worlds Spawn Point"
#            - queue clear
#        }
        - define world <player.world.name>
        - if <server.has_flag[<def[world]>_spawnpoint].not> {
            - if <server.has_flag[Survival]> {
                - if <def[world]> == Miscere_resource {
                    - if <player.has_flag[Cruthadaire].not> {
                        - narrate "<&d>Teleporting you to Spawn in <&e>5 <&d>seconds"
                        - wait 1s
                        - narrate "<&d>Teleporting you to Spawn in <&e>4 <&d>seconds"
                        - wait 1s
                        - narrate "<&d>Teleporting you to Spawn in <&e>3 <&d>seconds"
                        - wait 1s
                        - narrate "<&d>Teleporting you to Spawn in <&e>2 <&d>seconds"
                        - wait 1s
                        - narrate "<&d>Teleporting you to Spawn in <&e>1 <&d>second"
                        - wait 1s
                    }
                    - teleport <player> <server.flag[Miscere_spawnpoint]>
                    - queue clear
                }
            }
            - narrate "<&6>Spawn Point for %world% has not been set"
            - queue clear
        }
        - if <player.has_flag[Cruthadaire].not> {
            # Make you wait
            - narrate "<&d>Teleporting you to Spawn in <&e>5 <&d>seconds"
            - wait 1s
            - narrate "<&d>Teleporting you to Spawn in <&e>4 <&d>seconds"
            - wait 1s
            - narrate "<&d>Teleporting you to Spawn in <&e>3 <&d>seconds"
            - wait 1s
            - narrate "<&d>Teleporting you to Spawn in <&e>2 <&d>seconds"
            - wait 1s
            - narrate "<&d>Teleporting you to Spawn in <&e>1 <&d>second"
            - wait 1s
        }
        - if <server.has_flag[Survival]> {
            - teleport <player> <server.flag[Miscere_spawnpoint]>
            - queue clear
        }
        - teleport <player> <server.flag[<def[world]>_spawnpoint]>
        - if <player.has_flag[Cruthadaire].not> {
            - flag player spawn_cooldown d:5s
        }