Jump to content

AFK in Scoreboard


Recommended Posts

this would do i think:

getPlayerIdleTime -- checks his idle time 
setElementData -- for the score board 

it's easy.

tested and works, make sure to add AFK Scoreboard column

function checkAFKPlayers() 
    for index, thePlayer in ipairs(getElementsByType("player"))do  
        if (getPlayerIdleTime(thePlayer) > 5000) then -- Player hasn't moved for 5 seconds 
            setElementData(thePlayer, "AFK", "Yes") 
           else 
             setElementData(thePlayer, "AFK", "No") 
        end 
    end 
end 
setTimer(checkAFKPlayers, 2000, 0) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...