function funcInput ( key, keyState )
afkTime = 60*2
if ( keyState == "up" ) then
setTimer(afkgo,afkTime,1)
end
if ( keyState == "down" ) then
afktimer = getTimers ( afkTime)
for timerKey, timerafk in ipairs(afktimer) do
killTimer ( timerafk )
end
end
end
function afkgo()
afkTime =600*2
afktimer = getTimers ( afkTime)
for timerKey, timerafk in ipairs(afktimer) do
killTimer ( timerafk )
end
outputChatBox ( "afk" )
end
function bindTheKeys ()
bindKey ( "forwards", "down", funcInput )
bindKey ( "forwards", "up", funcInput )
bindKey ( "backwards ", "down", funcInput )
bindKey ( "backwards ", "up", funcInput )
bindKey ( "left", "down", funcInput )
bindKey ( "left", "up", funcInput )
bindKey ( "right", "down", funcInput )
bindKey ( "right", "up", funcInput )
end
addEventHandler("onClientPlayerSpawn",getLocalPlayer(),bindTheKeys)
does this work ? if no how to fix