TorNix~|nR Posted July 10, 2016 Share Posted July 10, 2016 hello everyone, who know how to do this in scoreboard? (AFK) I have 1 year searched this, I try to make it and I can not, any one know how? Link to comment
Bean666 Posted July 10, 2016 Share Posted July 10, 2016 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
TorNix~|nR Posted July 10, 2016 Author Share Posted July 10, 2016 Thanks Shaman123, works fine Link to comment
Bean666 Posted July 10, 2016 Share Posted July 10, 2016 np. i believe there are other more efficient ways to do that, but that is just an example. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now