• Kick AFK automatic
    3 replies, posted
Hello How to kick AFK player automatic ? Best Regards [highlight](User was banned for this post ("Help & Support" - Orkel))[/highlight] [highlight](User was banned for this post ("tons of help & support threads in the wrong section" - Orkel))[/highlight]
Something like this. [lua] local MaxTime = 60 hook.Add("Think", "AFK_Kick", function() for k, v in pairs(player.GetAll()) do if v.LastCheck < CurTime() + MaxTime then v:Kick("AFK") end end end) hook.Add("PlayerStartVoice", "AFK_Voice", function(ply, txt, tm) ply.LastCheck = CurTime() + 60 end) hook.Add("PlayerSay", "AFK_Chat", function(ply, txt, tm) ply.LastCheck = CurTime() + 60 end) hook.Add("StartCommand", "AFK_Move", function(ply, cmd) ply.LastCheck = CurTime() + 60 end) [/lua]
I place this line in lua>autorun? or lua>autorun>server ? And how edit the time ? Is in seconds or minute ? Best regards
Seconds
Sorry, you need to Log In to post a reply to this thread.