kevin11 Posted May 8, 2010 Share Posted May 8, 2010 (edited) 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 May 29, 2010 by Guest Link to comment
Jason_Gregory Posted May 8, 2010 Share Posted May 8, 2010 Omfg change the Color and use getLocalPlayer() case Sensitive Link to comment
dzek (varez) Posted May 9, 2010 Share Posted May 9, 2010 this script is a little mess.. one timer is enough.. and this: bindKey ( "forwards", "down", funcInput ) is incorrect.. "forwards" is not a key.. Link to comment
robhol Posted May 9, 2010 Share Posted May 9, 2010 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now