----------------------------------------SENTRY BUSTER LUA ---------------------------------------------------------- function CreateBuster(_, activator) if not activator then return end -----------------Stops players (aka hell-met) from abusing bot aggro without making bots ignore player busters BustTimerCountValue = 33 -- local BustTimerExplode -- BustTimerExplode = timer.Create(1, function () -- if activator == nil or not activator then -- timer.Stop(BustTimerExplode) -- return -- else -- BustTimerCountValue = BustTimerCountValue - 1 -- if BustTimerCountValue <= 30 and BustTimerCountValue >= 0 and activator:IsAlive() == true and activator.m_hActiveWeapon:GetItemName() == "Bust Caber" then -- activator:AcceptInput("$DisplayTextCenter", "Force Detonation in: "..BustTimerCountValue, activator) -- else -- return -- end -- if BustTimerCountValue == 0 then -- if not activator then -- return -- end -- activator:AcceptInput("$taunt", nil, activator) -- timer.Stop(BustTimerExplode) -- end -- end -- end, 999) --------------------------------------Make thing go boom. local busterCallbackDeath = activator:AddCallback(ON_KEY_RELEASED, function(activator, key) --local findBotPlayers = ents.FindInBox(Vector(-300, -300, -300), Vector(300, 300, 300)) if key == IN_ATTACK and activator:IsAlive() and activator.m_hActiveWeapon:GetItemName() == "Bust Caber" then activator:AcceptInput("$taunt", nil, activator) BusterExplode(activator) end end) function BusterExplode(activator) local getActivatorOrigin = activator:GetAbsOrigin() local bustTimer bustTimer = timer.Create(1.99, function() if activator:InCond(7) == true and activator:IsAlive() and activator.m_hActiveWeapon:GetItemName() == "Bust Caber" then local bustExplode = ents.CreateWithKeys("tf_point_weapon_mimic", { origin = "9999 9999 9999", targetname = "buster_rocket", -- i know its a sticky and not a rocket leave me alone teamnum = "3", Damage = "900", SplashRadius = "294", -- rocket x 2 blast radius WeaponType = "3", SpeedMax = "1000", SpeedMin = "1000", ModelOverride = "models/empty.mdl", angles = "90 0 0", }, true, true) -- ullapool_caber_explosion local particleBust = ents.CreateWithKeys("info_particle_system", { origin = "9999 9999 9999", targetname = "explosion_buster_particle", start_active = "0", effect_name = "hightower_explosion", flag_as_weather = "0", angles = "-90 0 0" }, true, true) particleBust:Teleport(getActivatorOrigin, nil, nil) bustExplode:Teleport(getActivatorOrigin, nil, nil) particleBust:AcceptInput("Start", nil, particleBust) bustExplode:AcceptInput("$SetOwner", activator, bustExplode) --bustExplode:AcceptInput("FireOnce", nil, bustExplode) --bustExplode:AcceptInput("DetonateStickies", nil, bustExplode) local stickyExplodeTimer = 0.030 local stickyShoot stickyShoot = timer.Create(0.015, function () stickyExplodeTimer = stickyExplodeTimer - 0.015 if stickyExplodeTimer >= 0 then bustExplode:AcceptInput("FireOnce", nil, bustExplode) bustExplode:AcceptInput("DetonateStickies", nil, bustExplode) else timer.Stop(stickyShoot) end end, 999) local entityKill = 3 local killTimer killTimer = timer.Create(1, function () entityKill = entityKill - 1 if entityKill == 0 then bustExplode:AcceptInput("kill", nil, bustExplode) particleBust:AcceptInput("kill", nil, particleBust) timer.Stop(killTimer) end end, 999) RemoveAllCallBacks(activator) activator:AcceptInput("$suicide", nil, activator) timer.Stop(bustTimer) end end, 1) end local busterTauntTimer -- check for if the player taunted and didnt attack busterTauntTimer = timer.Create(0.015, function () if activator:InCond(7) == true then --print("taunt!") timer.Stop(busterTauntTimer) BusterExplode(activator) end end, 0) function RemoveAllCallBacks(activator) activator:RemoveCallback(busterCallbackDeath) --activator:SwitchClassInPlace(previousClass) --activator:SetAttributeValue("no_attack", nil) end local deathCallbacks = activator:AddCallback(9, function() RemoveAllCallBacks(activator) end) end