#Check if player is afk

1 messages · Page 1 of 1 (latest)

full light
#

Trying to have it so if a player is afk in a region, itll teleport them to spawn. Is it possible to check if a player is AFK in skript?

frank hatch
#
every 5 seconds:
    add 5 to {afk::%player%}

on any move:
    if {afk::%player%} is set:
        clear {afk::%player%}```
full light
#

That is not what I’m looking for

#
    loop all players:
        if loop-player is in the region "xpborder" or "endborder":
            if {%loop-player%::afk} is true:
                execute console command "/spawn %loop-player%"
                send "Hey %loop-player%! You were afk at an XP Farm so the server automatically teleported you to spawn!" to loop-player```
#
on command "/afk":
    if {%event-player%::afk} is true:
        set {%event-player%::afk} to false
    if {%event-player%::afk} is false:
        set {%event-player%::afk} to true```
#

this is what i have so far

full light
craggy wagon
#

ah

#

i see

#

{%event-player%::afk} is not set so its not true but its also not false so it never gets set:

better use:

if {%event-player%::afk} is set:
        delete {%event-player%::afk}
else:
        set {%event-player%::afk} to true
full light
#

ah ok
thank you

#

Ill try that asap ^^

#

still nothing