I want to make my afk system use mouse position. I am not really sure how I would do this or explain it but basically it gets the players mouse position and if it hasnt changed after a certain amount of time it will continue to check but when it changes it activated a concommand. I really have no idea where to even start on this as I am a but confused on how it would actually work. Can anyone offer some code snippets? This would need to be clientside checking of course.
Heres my afk timer if anyone would like one.
AwayTime = 300
function AFK( ply )
for _, v in pairs( player.GetAll()) do
local a = (v:GetNWInt(“LA”) + AwayTime) - CurTime()
if a <= 0 then
if v:GetNWBool(“AFKN”) == true then
for k, ply in pairs( player.GetAll( ) ) do
timer.Create(“AFK_timer”, 1, 0, AFK)
function ResetAFK( ply )
concommand.Add( “ResetAFK”, ResetAFK )