local BotsOn = 0 local playercount = 0 local function chatMsg(p, t, r, m) if r ~= server or BotsOn == 0 then return end if m == "!botsoff" then COM_BufInsertText(server, "bots 0") BotsOn = 0 end if m == "!botseasy" then COM_BufInsertText(server, "bots 9") end if m == "!botshard" then COM_BufInsertText(server, "bots 13") end end local function mLoad(num) if BotsOn == 1 then print("Type '!botsoff' in chat to remove bots from the server until all players are disconnected") end end local function getPlayers() if BotsOn == 0 then playercount = 0 for player in players.iterate do playercount = $+1 end if not playercount then COM_BufInsertText(server, "bots 9") BotsOn = 1 end end end addHook("MapLoad", mLoad) addHook("ThinkFrame", getPlayers) addHook("PlayerMsg", chatMsg)