I have made an AFK system but it uses the UTime addon to get the session time. Is there any way to get the time session without UTime.
Code
You should check for player input, for example: (just wrote it now without testing so there might be errors)
local function doAFKTimer(ply)
timer.Create("AFKTimer"..ply:EntIndex(), 300, 1, function()
if IsValid(ply) then ply:Kick() end
end)
end
hook.Add("PlayerSpawn", "StartAFKTimer", function(ply)
doAFKTimer(ply)
end)
hook.Add("PlayerButtonDown", "ResetAFKTimer", function(ply)
doAFKTimer(ply)
end)
I added a config. And the config works but it doesn't do it's job. It doesn't block these commands and blocks all buttons being pressed but not actually blocking them only printing the message.
for k,v in pairs( Config.BlockedCommands, bind) do
ply:ChatPrint("This command is blocked.")
return false
end
end)
well that's because that's all you have it do?
GM/PlayerBindPress I used that function.
You're returning false for every blocked command but not checking if the command is blocked. Put a if in your loop.
Sorry, you need to Log In to post a reply to this thread.