Kick AFK automatic

Hello

How to kick AFK player automatic ?

Best Regards


(User was banned for this post ("Help & Support" - Orkel))


(User was banned for this post ("tons of help & support threads in the wrong section" - Orkel))

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