AFK Kicker Admin Exception

A mate made me this AFK kicker:
timer.Create( “afkTimer”, 5, 0, function()
for k,ply in pairs(player.GetAll()) do
if(ply.lastAngles != ply:GetAngles())then
ply.afk = CurTime()
ply.lastAngles = ply:GetAngles()
elseif(ply.afk < CurTime()-300)then
game.ConsoleCommand(“ulx kick “”…ply:Nick()…”" “AFK”

How can I edit it so it has an exception for user groups (IsUserGroup)

[lua]if ply:IsUserGroup(“vip”) then return end[/lua]
before the game.ConsoleCommand

Thanks mate, really appreciate contributers like you :slight_smile:

I wouldn’t recommend using the player angles to determine whether or not they’re afk as it can easily be defeated using +left or +right.

GetPos probably works best, or both.


What do you suggest? You’d have to use +forward and +left, which would eventually land you into a wall causing you to stick… I’d think.

You can make a script that does -forward;+forward;-forward;+right;-right and so on.

Just do it on keypresses…

Everytime a key is pressed it resets the counter.

I have used this AFK kicker for ages, it works well