Paste #67446: Untitled Paste

Date: 2020/04/14 09:42:43 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21


afk_player_handler:
    type: world
    debug: false
    events:
        on delta time minutely:
        - flag player afk_last_location:<player.location>
        - if <player.location.distance_squared[<player.flag[afk_last_location]>]> >= 100:
            - flag player afk_timer:0
        - else:
            - flag player afk_timer:++
        - if <player.flag[afk_timer]> > 3:
            - flag player afk_risk
        - if <player.flag[afk_timer]> >= 10:
            - kick player "reason:Disconnected for being AFK"
        - else if <player.flag[afk_timer]> == 9:
            - narrate "<red>HEY! You're going to be disconnected if you don't move around a little bit in the next minute!"
        - else if <player.flag[afk_timer]> >= 5:
            - narrate "<red>Hey! Are you AFK? You've been in the same area for quite a while! If you don't move in <element[10].sub[<player.flag[afk_timer]>]> minute, you'll be disconnected!"
        on player steps on block flagged:afk_risk:
            - flag player afk_timer:!
            - flag player afk_risk:!