Paste #51654: Untitled Paste

Date: 2019/01/19 00:07:44 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


sprinttestscript2:
    type: world
    debug: true
    events:
        #FIRST TIME FLAG
        on player starts sprinting:
        - if <player.has_flag[spt_value]> == false:
            - flag <player> spt_value:10
        #CHECKS IF PLAYER IS TIRED USE spt_resettimer
        - wait 1t
        - if <player.flag[spt_value]> >= 2:
            - while <player.is_sprinting>:
                - if <player.flag[spt_value]> > 0:
                    - flag <player> spt_value:--
                    - actionbar "<player.flag[spt_value]>"
                    - wait 1s
                #WHEN THE PLAYER GETS TIRED WHEN SPRINTING
                - else:
                    - adjust <player> food_level:2
                    - adjust <player> fake_health:<player.health>|10
                    - queue clear
        #IF THE PLAYER IS ALREADY TIRED
        - else:
           - adjust <player> food_level:2
           - adjust <player> fake_health:<player.health>|10


        on player stops sprinting:
        - wait 1t
        - if <player.flag[spt_value]> < 10:
            - while !<player.is_sprinting> && <player.flag[spt_value]> < 10:
                - if <player.flag[spt_value]> == 2:
                    - adjust <player> food_level:20
                    - adjust <player> fake_health:<player.health>|20
                - flag <player> spt_value:++
                - actionbar "<player.flag[spt_value]>"
                - wait 1s