so i know there 1000s of afk scripts out there .. this one a little epic from the others .. Not just the fact it FREE .. but when your players are AFK they get turned into a npc lol
WALKING
When a player is AFK for a little they will follow the npc path
DRIVING
Same as driving but on the road
to snap back to normal your player will have todo /back in chat to return to normal
would love to have an option instead of using a chat command where any button press cancels the afk… something like this?
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
for i = 0, 255 do
if IsControlPressed(i, 0) then
print("Key pressed: " .. i)
-- TriggerEvent Cancel AFK
end
end
end
end)
Though I doubt this code would work, just giving an example.
The idea is really cool, but I have a feeling players might abuse it at some point in the RPG, so here are some suggestions:
If a player is AFK for X amount of time, they will be kicked out of town, UNLESS the /afk command was applied (this would force players to use the /afk command to avoid being kicked out of town).
As soon as any keystroke or mouse movement is pressed, they will automatically exit AFK.
Or if the player is AFK for X amount of time, AFK mode will automatically activate.
i didnt want to this script to kick people from the game … this is why i made it this way lol
i have it set up as / command then the player has to be there to enter it … which means there no longer afk . if i did it as movement or key press its simple for someone to run back and move the mouse a little every time to stop it going in to afk mode
and thats what it already does lol
unsure how players can abuse it as its not like they have control over where there player moves to lol
But either way man … thank you for your feed back <3