#Paper Posted October 27, 2010 Posted October 27, 2010 This is MY afk killer, but don't work and no error is showed: Server-Side: local MaxAfkTime = 10 local AfkKickReason = "Afk for "..MaxAfkTime .." Seconds" local afkKeys = {"arrow_l", "arrow_u", "arrow_r", "arrow_d", "w", "s", "d", "a" } local afkTimer = nil local afkTime = 25000 -- 25 Seconds function onAfkEvent(afkTime) if client then setElementData(client , "idletime", tonumber(getElementData(client , "idletime")+tonumber(afkTime))) afkTime = AfkTime/1000 outputChatBox (getPlayerName(client).." is "..afkTime .." Seconds Afk!", getRootElement()) if afkTime > MaxAfkTime then setElementData(client, "idletime", 0) kickPed ( client, "Afk-Script", AfkKickReason ) end end end addEvent( "onAfkEvent", true ) addEventHandler( "onAfkEvent", getRootElement(), onAfkEvent) function pushKey( key, state ) if ( state == "down" ) then if isTimer(afkTime) then killTimer(afkTime) end end end function AfkKeys() setElementData(getLocalPlayer(), "idletime", 0) for key,keyNames in pairs(afkKeys) do bindKey(keynames, "both", pushKey) end end addEventHandler ( "onPlayerJoin", getRootElement(), AfkKeys) Client-Side: local afkTime = 25000 local afkKeys = {"arrow_l", "arrow_u", "arrow_r", "arrow_d", "w", "s", "d", "a" } local img = guiCreateStaticImage(378,283,402,163,"images/warning.png",false) function showimg( ) if afkTime then guiCreateStaticImage(378,283,402,163,"images/warning.png",false) end if afkKeys then guiSetVisible ( img , false ) end end
dzek (varez) Posted October 27, 2010 Posted October 27, 2010 If you CAN'T SCRIPT and you are TAKING (part of) somebody's else script - better take WHOLE. Your client does NOT makes ANY sense. Your server-side is partially copied from another topic. Bad luck this time I think.. edit: oh, i see, you are copied both client and server from Jason_Gregory's post and pasted as server-side
[DMC] Posted October 27, 2010 Posted October 27, 2010 i think you should just look more, i found 1 here and It works fine Go to the right(top) Type Afk killer and GL
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