I'm trying to get this code to work, but it's not adding the ban when they disconnect. Any ideas?
hook.Add("PlayerDisconnect", "BanForCheaterDisconnect", function(ply)
local plysteamid = ply:SteamID()
local plyname = ply:Nick()
local time = 1
local admin = "CONSOLE"
local reason = "(CHEATING) Don'try to cheat."
if ply:IsUserGroup("cheater") then
ULib.addBan(plysteamid, time, reason, plyname, admin)
end
end)