--[[ LMAOBOX LUA AUTO-VOTEKICK BY: @Gamer Incorporated ]] AVKActive = true local lastInvoke = 0 invokeTimeWait = 1 -- how often we call votekicks (in seconds) local kickReasons = {"cheating","idle","scamming","other"} kickReason = 1 local function arraySearch(array,searchF) for i, v in pairs(array) do if v == searchF then return {i,v} end end return nil end print("fazbear fred") local function AutoVoteKickDraw() if not AVKActive or not gamecoordinator.HasLiveMatch() or not gamecoordinator.IsConnectedToMatchServer() then return end if (globals.RealTime() - lastInvoke) < invokeTimeWait then return end lastInvoke = globals.RealTime() local list = entities.FindByClass("CTFPlayer") local partyMembers = party.GetMembers() local validList = {} local localPlayerTeam = entities.GetLocalPlayer():GetTeamNumber() local garbo = 1 for i, v in pairs(list) do local playerData = client.GetPlayerInfo(v:GetIndex()) -- sanitary checks to prevent mental retardation if v:GetTeamNumber() == localPlayerTeam then -- IGNORING STEAM FRIENDS AND PARTY MEMBERS (i have no fucking idea how to ignore players marked in lbox's player list, found nothing in docs) if not steam.IsFriend(playerData.SteamID) and not arraySearch(partyMembers,playerData.SteamID) then validList[garbo] = v garbo = garbo + 1 end end end if #validList > 0 then local chosen = validList[engine.RandomInt(1,#validList)] client.Command(string.format([[callvote kick "%d %s"]],client.GetPlayerInfo(chosen:GetIndex()).UserID,kickReasons[kickReason]),true) end end -- engine.Notification("AUTO-VOTEKICK EXECUTED","Use 'lua AVKActive = false' to disable\n 'lua AVKActive' to turn it back on\nTo change kick reason do 'lua kickReason = [number]'\n[number] is between 1 and 4\n1 - cheating, 2 - idle, 3 - scamming, 4 - no reason, different numbers cause no reason\n\n\ncreated by gamer incorporated",true) callbacks.Register("Draw", "AutoVoteKickDraw", AutoVoteKickDraw)