Jump to content

afk killer problem


Recommended Posts

this is problem in debugscript 3 :afktimer.lua:40 attempt to call global 'getlocalplayer'

this is the code i have

function funcInput ( key, keyState )
 
afkTime =60000*15
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 =60000*15
     afktimer = getTimers ( afkTime)
for timerKey, timerafk in ipairs(afktimer) do
killTimer ( timerafk )
end
outputChatBox ( "afk" )
end
 
 
function bindTheKeys ()
outputChatBox("jupp")
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)

Edited by Guest
Link to comment

kevin, can you please try to listen to people and use properly indented code in the proper format? Write [lua], it's not that freaking hard. Also, this is a kinda dumb mistake, one you wouldn't make if you had the basics of Lua down. Seriously. Read a little.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...