function FarmAmount(activator, amount) amount = tonumber(amount) local TIME_OUT_DURATION = 0.5 print("granting " .. amount .. " robots destroyed") activator.m_hActiveWeapon:SetAttributeValue("killstreak tier", 1) local damageInfo = { Attacker = activator, Inflictor = nil, Weapon = activator.m_hActiveWeapon, Damage = 125, DamageType = DMG_GENERIC, DamageCustom = TF_DMG_CUSTOM_NONE, DamagePosition = Vector(0, 0, 0), DamageForce = Vector(0, 0, 0), ReportedPosition = Vector(0, 0, 0), } local origin = activator:GetAbsOrigin() + Vector(1000, 0, 0) local timeOutCounter = 0 local totalAmount = 0 local function farmLoop() local bot = SpawnBot({ Class = CLASSES.Scout, Skill = BOT_SKILL.EASY, }, nil, true) if bot then totalAmount = totalAmount + 1 if totalAmount > amount then print("terminated at " .. totalAmount) return end bot.m_bIsMiniBoss = 1 bot:SetAbsOrigin(origin) timeOutCounter = timeOutCounter + 1 if timeOutCounter >= 11 then timeOutCounter = 0 timer.Simple(0.015, function() bot:TakeDamage(damageInfo) end) timer.Simple(TIME_OUT_DURATION, function() farmLoop() end) else timer.Simple(0.015, function() bot:TakeDamage(damageInfo) farmLoop() end) end else farmLoop() end end farmLoop() end -- sm_ent_fire popscript $OpenFarmMenu function OpenFarmMenu(_, activator) local menu = { timeout = 0, title = "Select Amount", itemsPerPage = 10, flags = MENUFLAG_BUTTON_EXIT, onSelect = function(_player, _index, amount) FarmAmount(activator, amount) OpenFarmMenu(nil, activator) end, } local amounts = { 1, 5, 10, 20, 50, 100, 500, 1000, 6767, 10000, 20000, 50000, } for i, v in ipairs(amounts) do menu[i] = v end activator:DisplayMenu(menu) end