function OnGameTick() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then if IsValid( player:GetPlayerItemBySlot(2) ) and ( player:GetPlayerItemBySlot(2):GetItemName() == "TF_WEAPON_SHOVEL" or player:GetPlayerItemBySlot(2):GetItemName() == "Upgradable TF_WEAPON_SHOVEL" ) then player:SetAttributeValue("min respawn time",120) end if IsValid( player:GetPlayerItemBySlot(0) ) and ( player:GetPlayerItemBySlot(0):GetItemName() == "Пик Советского Союза" ) then player:SetAttributeValue("min respawn time",20) end if player:InCond(36) then if player.CrackCooldown <= 0 then player.CrackCooldown = 33 player:AcceptInput("RunScriptCode", "self.ViewPunch(QAngle(RandomInt(-5,5),RandomInt(-5,5),RandomInt(-5,5)))") player:AcceptInput("RunScriptCode", "ScreenFade(self, RandomInt(0,255), RandomInt(0,255), RandomInt(0,255), RandomInt(175,225), 1, 0.033, 1)") player:SetAttributeValue("pyrovision opt in DISPLAY ONLY",1) player:SetAttributeValue("vision opt in flags",1) player:SetAttributeValue("major move speed bonus",2) player:SetAttributeValue("major increased jump height",2) player:SetAttributeValue("halloween fire rate bonus",0.5) player:SetAttributeValue("halloween reload time decreased",0.5) player:SetAttributeValue("gesture speed increase",2) player:SetAttributeValue("taunt attack time mult",0.5) player:SetAttributeValue("hud overlay","effects/dodge_overlay") player:TakeDamage({Attacker = player, Damage = 12, DamageType = 131072}) else player.CrackCooldown = player.CrackCooldown -1 end else player.CrackCooldown = 0 player:SetAttributeValue("major move speed bonus",nil) player:SetAttributeValue("major increased jump height",nil) player:SetAttributeValue("halloween fire rate bonus",nil) player:SetAttributeValue("halloween reload time decreased",nil) player:SetAttributeValue("pyrovision opt in DISPLAY ONLY",nil) player:SetAttributeValue("vision opt in flags",nil) player:SetAttributeValue("gesture speed increase",nil) player:SetAttributeValue("taunt attack time mult",nil) player:SetAttributeValue("hud overlay",nil) end elseif player:IsBot() then if player:InCond(36) then if player.CrackCooldown <= 0 then player.CrackCooldown = 33 player:SetAttributeValue("major move speed bonus",2) player:SetAttributeValue("major increased jump height",2) player:SetAttributeValue("halloween fire rate bonus",0.5) player:SetAttributeValue("halloween reload time decreased",0.5) player:SetAttributeValue("gesture speed increase",2) player:SetAttributeValue("taunt attack time mult",0.5) player:AcceptInput("$BotCommand","switch_action Mobber") player:TakeDamage({Attacker = player, Damage = 12, DamageType = 131072}) else player.CrackCooldown = player.CrackCooldown -1 end else player.CrackCooldown = 0 player:SetAttributeValue("major move speed bonus",nil) player:SetAttributeValue("major increased jump height",nil) player:SetAttributeValue("halloween fire rate bonus",nil) player:SetAttributeValue("halloween reload time decreased",nil) player:SetAttributeValue("gesture speed increase",nil) player:SetAttributeValue("taunt attack time mult",nil) end end end end function EatTheFish(damage, activator, caller) --activator is the one with the weapon, caller is the one that got hit if caller:IsPlayer() then caller:AddCond(36,10) end end function OnPlayerConnected(player) if player:IsPlayer() then player.CrackCooldown = 0 end end local BASE_HEIGHT = 80 local waiting = { Carriers = {}, Carried = {}, } function OnWaveReset(wave) waiting = { Carriers = {}, Carried = {}, } end -- just in case function OnWaveInit(wave) waiting = { Carriers = {}, Carried = {}, } end function OnWaveSpawnBot(bot, wave, tags) for _, tag in pairs(tags) do local split = {} for k, _ in string.gmatch(tag, '([^_]+)') do table.insert(split, k) end if split[1]:lower() == "pair" then local pairName = split[2] local pairPlacement = split[3]:lower() local waitTable local otherWaitTable if pairPlacement == "carried" then waitTable = waiting.Carried otherWaitTable = waiting.Carriers bot:AddCond(TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED) elseif pairPlacement == "carrier" then waitTable = waiting.Carriers otherWaitTable = waiting.Carried else print("invalid carrier placement tag") end if not waitTable[pairName] then waitTable[pairName] = {} end table.insert(waitTable[pairName], bot) if otherWaitTable[pairName] and otherWaitTable[pairName][1] then PairBots(waiting.Carriers[pairName][1], waiting.Carried[pairName][1]) waiting.Carriers[pairName] = nil waiting.Carried[pairName] = nil end end ::continue:: end end function PairBots(carrier, carried) local height = BASE_HEIGHT * (carrier.m_flModelScale) local carrierCallbacks = {} local carrierTimer local lastOrigin local function teleport() if not IsValid(carrier) then if not lastOrigin then return end if not IsValid(carried) or not carried:IsAlive() then return end -- prevents carried briefly disappearing after carrier death carried:SetAbsOrigin(lastOrigin + Vector(0, 0, height)) return end local origin = carrier:GetAbsOrigin() carried:SetAbsOrigin(origin + Vector(0, 0, height)) lastOrigin = origin end carrierTimer = timer.Create(0, function() teleport() end, 0) teleport() local function endPairLogic() for _, id in pairs(carrierCallbacks) do carrier:RemoveCallback(id) end timer.Stop(carrierTimer) end carrierCallbacks.died = carrier:AddCallback(ON_DEATH, function() carried:RemoveCond(TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED) timer.Simple(2, function () carried:SetAttributeValue("no_attack", nil) end) -- carried:ClearFakeParent() endPairLogic() if not lastOrigin then return end -- suspend in place to prevent source jank from teleporting it back to spawn local iterated = 1 for _ = 0, 1, 0.1 do timer.Simple(0.07 * iterated, function() carried:SetAbsOrigin(lastOrigin) end) iterated = iterated + 1 end end) carrierCallbacks.spawn = carrier:AddCallback(ON_SPAWN, function() endPairLogic() end) end