Paste #66141: Untitled Paste

Date: 2020/03/14 12:05:11 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


zoom:
    debug: true
    type: command
    name: zoom
    description: zoom
    usage: /zoom
    #permission:
    aliases:
        - z
    script:
        - if <context.args.is_empty>:
            - if <player.flag[zoom]||null> == null:
                - flag player zoom:default
                - while <player.flag[zoom]||null> == default:
                    - adjust <player> fov_multiplier:-0.1
                    - actionbar '<&e><&l>Zoom<&f><&l>: <&a><&l>100<&pc> <&7>/z to toggle'
                    - wait 1s
            - else:
                - adjust <player> fov_multiplier
                - actionbar <&r>
                - flag player zoom:!
        - else:
            - if <context.args.get[1].is_decimal> && <context.args.size> == 1 && <context.args.get[1]> >= 1 && <context.args.get[1]> <= 100:
                - if <context.args.get[1]> <= 50:
                    - adjust <player> fov_multiplier:<element[0.018].mul[<context.args.get[1]>].add[0.1]>
                    - flag player zoom:<context.args.get[1]>
                - if <context.args.get[1]> > 50 && <context.args.get[1]> < 100:
                    - adjust <player> fov_multiplier:<element[-1].add[<element[0.02].mul[<context.args.get[1].sub[50]>]>]>
                    - flag player zoom:<context.args.get[1]>
                - if <context.args.get[1]> == 100:
                    - adjust <player> fov_multiplier:-0.1
                    - flag player zoom:<context.args.get[1]>
                - while <player.flag[zoom]||null> == <context.args.get[1]>:
                    - actionbar '<&e><&l>Zoom<&f><&l>: <&a><&l><context.args.get[1]><&pc> <&7>/z to toggle'
                    - wait 1s
            - else:
                - narrate '<&c>Incorrect command usage! Specify one number between 1 and 100'