Hi I am trying to make an AFK kicker but i keep getting errors
[CODE]local function AFKKicker()
ply.butRelease = 0
ply = player.GetAll()
ply.butRelease = CurTime()
if CurTime() - ply.butRelease < 5 then
ply:Kick( "You were afk for to long" )
end
end
hook.Add("PlayerButtonUp", "ButtonLetGo", AFKKicker)
local function AFKCheck()
ply.butRelease = 0
ply = player.GetAll()
if (CurTime() >= ply.butRelease) then
end
end
hook.Add("Think", "thinkhook", AFKCheck)[/CODE]
also i do not want some huge code you made or a download one i want someone to help me fix mine my error at the moment is
[ERROR] addons/brettscripts/lua/autorun/server/afkkicker.lua:6: attempt to call method 'Kick' (a nil value)
1. v - addons/brettscripts/lua/autorun/server/afkkicker.lua:6
2. unknown - lua/includes/modules/hook.lua:84
[img]http://puu.sh/a5BwM/8feb17b31d.png[/img]
Please remake your thread in the correct section.
Sorry, you need to Log In to post a reply to this thread.