Paste #70126: script duskley

Date: 2020/06/02 11:41:38 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


minage:
    type: command
    name: minage
    description: permet de se tp aux monde ressource
    usage: /minage
    script:
        - flag player tpcancelled:!
        - if <player.world.name> != Monde_ressource:
            - if <player.world.name> == Monde_construction:
                - if <player.location.find.entities[cave_spider|enderman|spider|blaze|creeper|drowned|elder_guardian|endermite|evoker|ghast|guardian|husk|illusioner|magma_cube|phantom|pillager|ravager|shulker|silverfish|skeleton|slime|stray|vex|vindicator|witch|wither_skeleton|zombie|zombie_villager|ender_dragon|wither].within[5].is_empty>:
                    - narrate "<gold>Vous allez etre tp ne bougez pas sinon le tp va etre annulez"
                    - flag player temps:5
                    - while !<player.has_flag[tpcancelled]> && <player.flag[temps]> != 0:
                        - narrate "temps restant avant tp :<red> <player.flag[temps]>"
                        - flag player temps:-:1
                        - wait 1s
                    - flag player temps:!
                    - if <player.has_flag[tpcancelled]>:
                        - narrate "<gold>Le tp a ete annulé"
                    - else:
                        - flag player avantlocation:<player.location.simple>
                        - flag player test
                        - flag player tentative
                        - flag player nouvellelocation:<player.location.simple.as_location.with_world[Monde_ressource]>
                        - while <player.has_flag[test]> || <player.flag[tentative]> < 10:
                            - flag player nouvellelocation:<player.flag[nouvellelocation].as_location.with_x[<util.random.int[0].to[1000]>]>
                            - flag player nouvellelocation:<player.flag[nouvellelocation].as_location.with_z[<util.random.int[0].to[1000]>]>
                            - chunkload <player.flag[nouvellelocation].as_location.chunk>
                            - flag player nouvellelocation:<player.flag[nouvellelocation].as_location.highest>
                            - chunkload remove <player.flag[nouvellelocation].as_location.chunk>
                            - if <player.flag[nouvellelocation].as_location.material.name> != lava:
                                - flag player test:!
                            - else:
                                - flag player tentative:++
                        - if <player.flag[tentative]> == 10:
                            - narrate "<gold>Aucun point de tp n'as pu etre trouvé veuillez recommencez !"
                        - else:
                            - teleport <player.name> <player.flag[nouvellelocation]>
                        - flag player tentative:!
                - else:
                    - narrate "<gold>Il y a des monstres a proximités vous ne pouvez pas vous tp"
            - else:
                - narrate "<gold>Vous devez etre dans le monde <red>Monde_construction <gold>pour pouvoir vous tp dans le monde <red>Monde_ressouce"

aventure:
    type: command
    name: aventure
    description: permet de se tp aux monde construction
    usage: /aventure
    script:
    - flag player tpcancelled:!
    - if <player.world.name> != Monde_construction:
        - if <player.world.name> == Monde_ressource:
            - if <player.location.find.entities[cave_spider|enderman|spider|blaze|creeper|drowned|elder_guardian|endermite|evoker|ghast|guardian|husk|illusioner|magma_cube|phantom|pillager|ravager|shulker|silverfish|skeleton|slime|stray|vex|vindicator|witch|wither_skeleton|zombie|zombie_villager|ender_dragon|wither].within[5].is_empty>:
                - narrate "<gold>Vous allez etre tp ne bougez pas sinon le tp va etre annulez"
                - flag player temps:5
                - while !<player.has_flag[tpcancelled]> && <player.flag[temps]> != 0:
                    - narrate "Temps restant avant tp :<red> <player.flag[temps]>"
                    - flag player temps:-:1
                    - wait 1s
                - if <player.has_flag[tpcancelled]>:
                    - narrate "<gold>Le tp a ete annulé"
                - else:
                    - teleport <player.name> <player.flag[avantlocation]>
            - else:
                - narrate "<gold>Il y a des monstres a proximités vous ne pouvez pas vous tp"
        - else:
            - narrate "<gold>Vous devez etre dans le monde <red>Monde_ressouce <gold>pour pouvoir vous tp dans le monde <red>Monde_construction"

reasontpcancel:
    type: world
    events:
        on entity targets player:
            - flag player tpcancelled
        on player killed by entity:
            - flag player tpcancelled
        on player walks:
            - flag player tpcancelled
        on player damaged:
            - narrate "hello"
            - flag player tpcancelled