--Made by Wacev --https://steamcommunity.com/profiles/76561198009331097/ --You may use an unmodified version of this lua file if you credit me --Please do not copy or modify this lua file --Note: I AM ok if you copy it for learning purposes and DO NOT claim it as your own --Contact me on discord if Mince requests I take this down for copying --Cool ideas and todos: --add auto cash collectors to shut off sectors --rework some weapons --add alt fire to taser, make it have cool explosion that deals damage when proj expires --[[ the following functions are copied from winterbridge necromantic nonsense for my sanity --]] CEntity.IsMidair = function(self) if (IsValidAlivePlayer(self)) then return not (self.movetype == MOVETYPE_WALK and (self.m_fFlags & FL_ONGROUND ~= 0)); end end function IsValidAlivePlayer(ent) return IsValid(ent) and ent:IsPlayer() and ent:IsAlive(); end function IsValidAliveRealPlayer(ent) return IsValid(ent) and ent:IsRealPlayer() and ent:IsAlive(); end function IsValidRealPlayer(ent) return IsValid(ent) and ent:IsRealPlayer(); end function IsValidPlayer(ent) return IsValid(ent) and ent:IsPlayer(); end CEntity.IsInvuln = function(self) if (not IsValidPlayer(self)) then return end if (self:InCond(TF_COND_INVULNERABLE) or self:InCond(TF_COND_INVULNERABLE_CARD_EFFECT) or self:InCond(TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED) or self:InCond(TF_COND_INVULNERABLE_USER_BUFF)) then return true end return false end math.randomfloat = function(m, n) if (m) then if (n) then if (n == m) then return m; elseif (m > n) then m, n = n, m; end -- n should be greater than m local dif = n - m; local mod = dif * math.random(); return m + mod; else return m * math.random(); end else return math.random(); end end --[[ the following functions are made by me --]] function RefreshBoostpack(player) if player:IsRealPlayer() then if player.charge ~= 100 then pcall(timer.Stop, player.RechargeTimer) player.charge = 100 player.boostReady = true player:PlaySoundToSelf("TFPlayer.ReCharged") player:PlaySound("Weapon_RocketPack.BoostersReady") end timer.Simple(0.1, function() player:ShowHudText({channel = 4, y = 0.90, x = 0.65, r1 = 250, r2 = 250, g1 = 250, g2 = 250, b1 = 250, b2 = 250, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 0.01, holdTime = 0.01}, "" ) player:ShowHudText({channel = 3, y = 0.90, x = 0.65, r1 = 250, r2 = 250, g1 = 250, g2 = 250, b1 = 250, b2 = 250, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 0.01, holdTime = 0.01}, "" ) end) timer.Simple(0.2, function() if not player.boostSafety then player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 100, r2 = 100, g1 = 250, g2 = 250, b1 = 50, b2 = 50, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "[100%] Ready") else player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 250, r2 = 250, g1 = 50, g2 = 50, b1 = 0, b2 = 0, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "Boost Safety On") end player:ShowHudText({channel = 4, y = 0.8, x = 0.8, r1 = 50, r2 = 50, g1 = 100, g2 = 100, b1 = 250, b2 = 250, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "[Reload + Boost Key to toggle safety]") end) end end function Upgrade(value, activator, caller) if IsValidRealPlayer(activator) then RefreshBoostpack(activator) end end function OnGameTick() for _, player in pairs(ents.GetAllPlayers()) do if player:IsValid() then if player:IsRealPlayer() then player:SetAttributeValue("head scale", nil) player:SetAttributeValue("increased jump height", nil) player:SetAttributeValue("voice pitch scale", 0.9) else player:SetAttributeValue("head scale", nil) end end if IsValidAlivePlayer(player) and (player.m_iTeamNum ~= 1) and (player.m_iClass == TF_CLASS_DEMOMAN) and (IsValid(player:GetPlayerItemBySlot(1))) then if (player:GetPlayerItemBySlot(1):GetItemName() == "Energy Shield") then if player:InCond(17) or (player:InCond(83)) then player:GetPlayerItemBySlot(1):SetAttributeValue("dmg taken increased",0.5) else player:GetPlayerItemBySlot(1):SetAttributeValue("dmg taken increased",nil) end end end if IsValidAliveRealPlayer(player) and (player.m_iTeamNum == 2) then -- teamnum 2 is red, it should fix scripts getting nil value every tick for _,v in pairs(ents.FindAllByClass("tf_viewmodel")) do if player:IsAlive() and (v.m_hOwner == player) and (v.m_hOwner.m_hActiveWeapon:GetItemName() == "Energy Ax") then v.m_flPlaybackRate = player.plyViewSpeed end end if player.boostMinicritBoost == true then if player.boosting == true or player.slamming == true then player:Addcond(56) player:SetAttributeValue("crits_become_minicrits", 1) else player:RemoveCond(56) player:SetAttributeValue("crits_become_minicrits", nil) end end if player.boosting == true or player.slamming == true then player:SetAttributeValue("no double jump", 1) else player:SetAttributeValue("no double jump", nil) end if ( player:InCond(130) ) and ( not player.robot ) then player:AcceptInput("SetCustomModelWithClassAnimations", "models/bots/heavy/bot_heavy.mdl") player.robot = true elseif ( not player:InCond(130) ) and ( player.robot ) then player:AcceptInput("SetCustomModelWithClassAnimations", "") --emtpy param on SetCustomModelWithClassAnimations = default model player.robot = false end local upgradeLvl = player:GetAttributeValue("tag__summer2014") local upgradeLvl2 = player:GetAttributeValue("tag__eotlearlysupport") local upgradeLvl3 = player:GetAttributeValue("cannot trade") local upgradeLvl4 = player:GetAttributeValue("taunt is highfive") local upgradeLvl5 = player:GetAttributeValue("purchased") local upgradeLvl6 = player:GetAttributeValue("Wrench index") if upgradeLvl ~= nil then if player.chargeTickTime ~= player.baseTickTime - upgradeLvl *0.15 then player.chargeTickTime = player.baseTickTime - upgradeLvl *0.15 end else player.chargeTickTime = player.baseTickTime end if upgradeLvl2 ~= nil then if player.boostTime ~= player.baseBoostTime + upgradeLvl2 *0.25 then player.boostTime = player.baseBoostTime + upgradeLvl2 *0.25 end else player.boostTime = player.baseBoostTime end if upgradeLvl3 ~= nil then if player.boostSpeed ~= player.baseBoostSpeed + upgradeLvl3 *100 then player.boostSpeed = player.baseBoostSpeed + upgradeLvl3 *100 end else player.boostSpeed = player.baseBoostSpeed end if upgradeLvl4 ~= nil then if upgradeLvl4 >= 1 then player.boostGroundSlamAllowed = true end else player.boostGroundSlamAllowed = false end if upgradeLvl5 ~= nil then if upgradeLvl5 >= 1 then player.boostMinicritBoost = true end else player.boostMinicritBoost = false end if upgradeLvl6 ~= nil then if player.slammingEfficiency ~= player.baseSlammingEfficiency + upgradeLvl6 then player.slammingEfficiency = player.baseSlammingEfficiency + upgradeLvl6 end else player.slammingEfficiency = player.baseSlammingEfficiency end end if player:IsBot() then if player:InCond(71) and player.m_bIsMiniBoss == 1 then player:RemoveCond(71) end if player:InCond(43) and ( not player.Recoded ) then player:AcceptInput("$BotCommand","switch_action Mobber") player.Recoded = true elseif ( not player:InCond(43) ) and ( player.Recoded ) then player:AcceptInput("$BotCommand","switch_action Default") player.Recoded = false player:AddCond(71, 3) end end end for _, player in pairs(ents.GetAllPlayers()) do -- ground slamming functions were copied and modified from winterbridge necromantic nonsense with changes made, credit to mince for the original script if (player:IsMidair() and player.boostGroundSlamAllowed == true and (player.boosting == false)) then if ( player.charge >= 1 ) and (not player.boostSafety) then player.boostGroundSlam = player.m_vecAbsVelocity.z < -500 if (player.crouching and player["m_angEyeAngles[0]"] >= 50) then if (not player.boostGroundSlamTimer) then pcall(timer.Stop, player.RechargeTimer); player.slamming = true player.boostGroundSlamTimer = timer.Create(0.015, function() player.charge = player.charge - 1 * player.slammingEfficiency player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 250, r2 = 250, g1 = 50, g2 = 50, b1 = 0, b2 = 0, effect = 2, fixTime = 0, fadeinTime = 0, holdTime = 0.075}, "Slamming [" ..math.floor(player.charge).."%]") if (not IsValidRealPlayer(player)) then if (player and player.boostGroundSlamTimer) then pcall(timer.Stop, player.boostGroundSlamTimer); player.boostGroundSlamTimer = nil end end local velocity = player.m_vecAbsVelocity if velocity.z > 0 then velocity.z = velocity.z * 0.8 else local mod = 1 + math.abs(1 / velocity.z * 30); velocity.z = velocity.z * mod end player.m_vecAbsVelocity = velocity end, 0) end end else if (player.boostGroundSlamTimer) then pcall(timer.Stop, player.boostGroundSlamTimer); player.boostGroundSlamTimer = nil RechargeBoost(player) player.boostGroundSlam = false player.slamming = false end end else if (player.boostGroundSlamTimer) then pcall(timer.Stop, player.boostGroundSlamTimer); player.boostGroundSlamTimer = nil end if (player.boostGroundSlam) then local victim = player.m_hGroundEntity if (IsValidPlayer(victim) and player.m_iTeamNum ~= victim.m_iTeamNum) then local pos = player:GetAbsOrigin() local dmg = player.m_iMaxHealth * 0.85 dmg = dmg * math.randomfloat(0.8,1.2) if (victim.m_bIsMiniBoss == 1) then dmg = dmg * 3 end if (not victim:IsInvuln()) then victim:TakeDamage({ Attacker = player, Inflictor = nil, Weapon = wep, Damage = dmg, DamageType = DMG_GENERIC | DMG_PREVENT_PHYSICS_FORCE, DamageCustom = TF_DMG_CUSTOM_BOOTS_STOMP, CritType = 0, DamagePosition = pos, DamageForce = Vector(0,0,0), ReportedPosition = pos, }); end victim:PlaySound("Weapon_Mantreads.Impact"); victim:PlaySound("Weapon_Mantreads.Impact"); victim:PlaySound("Player.FallDamageDealt"); victim:PlaySound("Player.FallDamageDealt"); util.ParticleEffect("stomp_text", pos); end end if player.slamming == true then RechargeBoost(player) end player.boostGroundSlam = false player.slamming = false end end end function teslaZap(damage, activator, caller) for _, player in pairs(ents.FindInSphere(activator:GetAbsOrigin(),192)) do if activator.m_iTeamNum ~= player.m_iTeamNum and (player:IsPlayer()) and (IsValid(activator:GetPlayerItemBySlot(0))) and (IsValid(player:GetPlayerItemBySlot(2))) and (IsValid(player:GetPlayerItemBySlot(1))) then --not same team local upgradeLvl = activator:GetPlayerItemBySlot(0):GetAttributeValue("damage bonus") if upgradeLvl == nil then upgradeLvl = 1 end if player:IsPlayer() then if player:GetPlayerItemBySlot(2):GetItemName() == "Astral Projection" then player:TakeDamage({Attacker = activator, Damage = 16.5 * upgradeLvl, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) elseif player:GetPlayerItemBySlot(1):GetItemName() == "Energy Shield" then player:TakeDamage({Attacker = activator, Damage = 5.5 * upgradeLvl, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) else player:TakeDamage({Attacker = activator, Damage = 11 * upgradeLvl, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) end else player:TakeDamage({Attacker = activator, Damage = 7 * upgradeLvl, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) end end end end function shockBeam(damage, activator, caller) ents.FindByName("FX_Shock_spawner"):Teleport(caller:GetAbsOrigin()) ents.FindByName("FX_Shock_spawner"):AcceptInput("ForceSpawn") for _, player in pairs(ents.FindInSphere(caller:GetAbsOrigin(),192)) do if activator.m_iTeamNum ~= player.m_iTeamNum and caller ~= player and (player:IsPlayer()) and (IsValid(activator:GetPlayerItemBySlot(0))) and (IsValid(activator:GetPlayerItemBySlot(2))) and (IsValid(player:GetPlayerItemBySlot(1))) then --not same team and not same bot local upgradeLvl = activator:GetPlayerItemBySlot(0):GetAttributeValue("damage bonus") if upgradeLvl == nil then upgradeLvl = 1 end if player:IsPlayer() then if player:GetPlayerItemBySlot(2):GetItemName() == "Astral Projection" then player:TakeDamage({Attacker = activator, Damage = 75 * upgradeLvl, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) elseif player:GetPlayerItemBySlot(1):GetItemName() == "Energy Shield" then player:TakeDamage({Attacker = activator, Damage = 25 * upgradeLvl, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) else player:TakeDamage({Attacker = activator, Damage = 50 * upgradeLvl, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) end else player:TakeDamage({Attacker = activator, Damage = 20 * upgradeLvl, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) end end end end function ammoOnKill(damage, activator, caller) --works for primary weapons only if IsValidRealPlayer(activator) and (IsValid(activator:GetPlayerItemBySlot(0))) then local upgradeLvl = activator:GetPlayerItemBySlot(0):GetAttributeValue("community description") if upgradeLvl == nil then upgradeLvl = 0; print("ammoOnKill called but no amount given") end activator.m_iAmmo[2] = activator.m_iAmmo[2] + upgradeLvl end end function bossTpFX(_,activator) ents.FindByName("FX_Tele_spawner"):Teleport(activator:GetAbsOrigin()) ents.FindByName("FX_Tele_spawner"):AcceptInput("ForceSpawn") end function BossSpark() for _, player in pairs(ents.FindInSphere(ents.FindByName("tesla_backpack_tesla"):GetAbsOrigin(),150)) do if player:IsRealPlayer() and (IsValid(player:GetPlayerItemBySlot(2))) and (IsValid(player:GetPlayerItemBySlot(1))) then if player.m_iClass == TF_CLASS_SPY then player:TakeDamage({Attacker = player, Damage = 18, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) --spy takes 1/2 damage elseif player:GetPlayerItemBySlot(2):GetItemName() == "Astral Projection" then player:TakeDamage({Attacker = player, Damage = 54, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) elseif player:GetPlayerItemBySlot(1):GetItemName() == "Energy Shield" then player:TakeDamage({Attacker = player, Damage = 18, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) else player:TakeDamage({Attacker = player, Damage = 36, DamageType = DMG_SHOCK, DamageCustom = TF_DMG_CUSTOM_PLASMA}) end end end end function OnWaveSpawnBot(bot, wave, tags) bot.Recoded = false end function classBasedRecharge(ply) if ply.m_iClass == TF_CLASS_SCOUT then return 8 elseif ply.m_iClass == TF_CLASS_SOLDIER then return 20 elseif ply.m_iClass == TF_CLASS_PYRO then return 10 elseif ply.m_iClass == TF_CLASS_DEMOMAN then return 12.5 elseif ply.m_iClass == TF_CLASS_HEAVYWEAPONS then return 32 elseif ply.m_iClass == TF_CLASS_ENGINEER then return 16 elseif ply.m_iClass == TF_CLASS_MEDIC then return 12.5 elseif ply.m_iClass == TF_CLASS_SNIPER then return 16 elseif ply.m_iClass == TF_CLASS_SPY then return 10 end end function OnPlayerDisconnected(player) -- Kill active timers if player:IsRealPlayer() then pcall(timer.Stop, player.boostGroundSlamTimer) pcall(timer.Stop, player.RechargeTimer) pcall(timer.Stop, player.ragebarTimer) end end function RechargeBoost(player) --if you intened to copy this to learn how it works, gl. I barely have an idea of how it works. player.boosting = false player:RemoveCond(83) player.charge = math.floor(player.charge) player.charge = math.abs(player.charge) player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 250, r2 = 250, g1 = 100, g2 = 100, b1 = 50, b2 = 50, effect = 2, fixTime = 0.01, fadeinTime = 0.01, holdTime = player.chargeTickTime - 0.25}, "Recharging [" ..player.charge.."%]") player.chargeTicks = classBasedRecharge(player) --player.chargePerTick = classBasedRechargeAmount(player) player.chargePerTick = 100 / player.chargeTicks player.boostReady = false player.RechargeTimer = timer.Create(player.chargeTickTime,function() --recharging player.charge = (player.charge + player.chargePerTick) if player.charge < 100 then player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 250, r2 = 250, g1 = 100, g2 = 100, b1 = 50, b2 = 50, effect = 2, fixTime = 0.01, fadeinTime = 0.01, holdTime = player.chargeTickTime - 0.25}, "Recharging [" ..player.charge.."%]") else player.charge = 100 player.boostReady = true player:PlaySoundToSelf("TFPlayer.ReCharged") player:PlaySound("Weapon_RocketPack.BoostersReady") if not player.boostSafety then player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 100, r2 = 100, g1 = 250, g2 = 250, b1 = 50, b2 = 50, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "[100%] Ready") else player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 250, r2 = 250, g1 = 50, g2 = 50, b1 = 0, b2 = 0, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "Boost Safety On") end pcall(timer.Stop, player.RechargeTimer) --pcall timer.stop works but not timer.stop on its own ????? end end, math.ceil(player.chargeTicks)) --repeats end function AddRage(damage, activator, caller) --activator is the one with the weapon, caller is the one that got hit if activator.ragebar and activator.ragebarBuild then activator.ragebarCurrent = activator.ragebarCurrent + damage if activator.ragebarCurrent > activator.ragebarMax then activator.ragebarCurrent = activator.ragebarMax end activator:ShowHudText({channel = 5, y = 0.90, x = 0.65, r1 = 250, r2 = 250, g1 = 250, g2 = 250, b1 = 250, b2 = 250, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "Rage: " .. ( activator.ragebarCurrent / activator.ragebarMax ) * 100 .. "%" ) end end function OnPlayerConnected(player) player.chargeTickTime = 1 player.baseTickTime = 1 player.boostTime = 1 player.baseBoostTime = 1 player.boostSpeed = 1000 player.baseBoostSpeed = 1000 player.plyViewSpeed = 1 player.chargeTicks = 30 player.chargePerTick = 10 player.charge = 100 player.slammingEfficiency = 1 player.baseSlammingEfficiency = 1 player.boostMinicritBoost = false player.boostGroundSlam = false player.boostGroundSlamAllowed = false player.boostGroundSlamTimer = nil player.RechargeTimer = nil player.crouching = false player.boostReady = true player.boosting = false player.slamming = false player.noboost = false player.boostSafety = false player.robot = false player.ragebar = false player.ragebarMax = 1000 player.ragebarCurrent = 0 player.ragebarBuild = true player.ragebarTimer = nil player.ragebarDuration = 20 if player:IsRealPlayer() then player:AddCallback(ON_START_TOUCH, function(entity,other,hitPos,hitNormal) --cancel boost if player.boosting == true then player.boosting = false player:RemoveCond(83) player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 250, r2 = 250, g1 = 50, g2 = 50, b1 = 0, b2 = 0, effect = 2, fixTime = 0.01, fadeinTime = 0.01, holdTime = player.boostTime - 0.25}, "Canceling Boost") end end) player:AddCallback(ON_DEPLOY_WEAPON, function(ent,weapon) --Energy Ax callback if weapon:GetItemName() == "Energy Ax" then player.plyViewSpeed = 0.5 else player.plyViewSpeed = 1 end end) player:AddCallback(ON_SPAWN, function(ent) RefreshBoostpack(ent) if IsValidAlivePlayer(player) and (player.m_iTeamNum ~= 1) and (player.m_iClass == TF_CLASS_DEMOMAN) and (IsValid(player:GetPlayerItemBySlot(2))) and ( player:GetPlayerItemBySlot(2):GetItemName() == "Energy Ax" ) then player.ragebar = true player.ragebarMax = 5000 player.ragebarCurrent = 0 timer.Simple(0.2, function() player:ShowHudText({channel = 5, y = 0.90, x = 0.74, r1 = 250, r2 = 250, g1 = 250, g2 = 250, b1 = 250, b2 = 250, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "Rage: 0%" ) end) else player.ragebar = false player:ShowHudText({channel = 5, y = 0.90, x = 0.65, r1 = 250, r2 = 250, g1 = 250, g2 = 250, b1 = 250, b2 = 250, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 0.01, holdTime = 0.01}, "" ) end end) player:AddCallback(ON_KEY_PRESSED, function(entity, key) if (key == IN_ATTACK3) then if ( not player.noboost ) then if ( not player.boostSafety ) and (player:IsMidair()) and (player.boostReady) and (player.charge >= 100) then player.boosting = true player.charge = 0 player:SetForwardVelocity(player.boostSpeed) player:Addcond(83,player.boostTime) player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 250, r2 = 250, g1 = 50, g2 = 50, b1 = 0, b2 = 0, effect = 2, fixTime = 0.01, fadeinTime = 0.01, holdTime = player.boostTime - 0.25}, "Boosting...") timer.Create(0.015, function() --boost if player.boosting == true then player:SetForwardVelocity(player.boostSpeed) end end, player.boostTime * 67) player:PlaySound("Weapon_RocketPack.BoostersFire") player:PlaySound("BumperCar.SpeedBoostStart") timer.Simple(player.boostTime,function() -- delay RechargeBoost(player) end) end else if player.boostSafety then if (player.boostReady) and (player.charge >= 100) then player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 100, r2 = 100, g1 = 250, g2 = 250, b1 = 50, b2 = 50, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "[100%] Ready") else player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 250, r2 = 250, g1 = 100, g2 = 100, b1 = 50, b2 = 50, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "Boost Safety Off") end player.boostSafety = false player:PlaySoundToSelf("buttons/combine_button1.wav") else player:ShowHudText({channel = 3, y = 0.75, x = 0.78, r1 = 250, r2 = 250, g1 = 50, g2 = 50, b1 = 0, b2 = 0, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "Boost Safety On") player.boostSafety = true player:PlaySoundToSelf("buttons/combine_button5.wav") end end elseif key == IN_DUCK then player.crouching = true elseif key == IN_RELOAD then player.noboost = true if ( player.m_iClass == TF_CLASS_DEMOMAN ) and ( player.ragebar ) then if player.ragebarCurrent >= player.ragebarMax then player:SetAttributeValue("gesture speed increase", 2) player:SetAttributeValue("always allow taunt", 1) player:GetPlayerItemBySlot(2):SetAttributeValue("mult smack time", nil) player:GetPlayerItemBySlot(2):SetAttributeValue("fire rate penalty", nil) timer.Simple(0.015, function() player:AcceptInput("$TauntFromItem", "Taunt: Roar O'War") end) player.plyViewSpeed = 1 player.ragebarBuild = false player.ragebarTimer = timer.Create(0.1, function() player.ragebarCurrent = player.ragebarCurrent - (player.ragebarMax/player.ragebarDuration)/10 player:ShowHudText({channel = 5, y = 0.90, x = 0.65, r1 = 250, r2 = 250, g1 = 250, g2 = 250, b1 = 250, b2 = 250, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "Rage: " .. math.floor(( player.ragebarCurrent / player.ragebarMax ) * 100) .. "%" ) end, 0 ) timer.Simple(player.ragebarDuration + 0.015, function() player:SetAttributeValue("gesture speed increase", nil) player:SetAttributeValue("always allow taunt", nil) player.plyViewSpeed = 0.5 player.ragebarCurrent = 0 player:ShowHudText({channel = 5, y = 0.90, x = 0.65, r1 = 250, r2 = 250, g1 = 250, g2 = 250, b1 = 250, b2 = 250, effect = 2, fixTime = 0.01, fadeinTime = 0.01, fadeoutTime = 10, holdTime = 9999}, "Rage: " .. ( player.ragebarCurrent / player.ragebarMax ) * 100 .. "%" ) player.ragebarBuild = true player:GetPlayerItemBySlot(2):SetAttributeValue("mult smack time", 2) player:GetPlayerItemBySlot(2):SetAttributeValue("fire rate penalty", 1.5) pcall(timer.Stop, player.ragebarTimer) end) end end end end) player:AddCallback(ON_KEY_RELEASED, function(entity, key) if key == IN_DUCK then player.crouching = false elseif key == IN_RELOAD then player.noboost = false end end) end end function Recode(_, activator, caller) if ( activator:IsValid() ) and ( caller:IsValid() ) and ( IsValid(activator:GetPlayerItemBySlot(4)) ) then local AddTime = activator:GetPlayerItemBySlot(4):GetAttributeValue("robo sapper") if AddTime == nil then AddTime = 0 else AddTime = AddTime * 2 end if caller.m_bIsMiniBoss == 1 then caller:AddCond(43, 5 + ( AddTime * 0.5 )) else caller:AddCond(43, 10 + AddTime) end end end