function GetVelocity(entity) return Vector(entity.m_vecVelocity[1], entity.m_vecVelocity[2], entity.m_vecVelocity[3]) end -- function OnPlayerConnected(player) player:AddCallback(ON_DAMAGE_RECEIVED_PRE, function(_, damageinfo) local wep = damageinfo.Weapon local attacker = damageinfo.Attacker local dmgtype = damageinfo.DamageType if wep ~= nil and wep:GetClassname() == "tf_weapon_sniperrifle" and (player.m_LastHitGroup == HITGROUP_RIGHTLEG or player.m_LastHitGroup == HITGROUP_LEFTLEG) then local duration = 2 + (wep.m_flChargedDamage / 20) player:StunPlayer(duration, 0.7, TF_STUNFLAG_SLOWDOWN | TF_STUNFLAG_NOSOUNDOREFFECT, attacker) player:RunScriptCode("self.AddCustomAttribute(`no_jump`, 1, " .. duration .. ")") attacker:PlaySoundToSelf("SolidMetal.BulletImpact") attacker:PlaySoundToSelf("=41|npc/roller/blade_out.wav") util.ParticleEffect("ExplosionCore_sapperdestroyed", damageinfo.DamagePosition, nil, player) end return true end) end ents.AddCreateCallback("obj_*", function(ent) ent:AddCallback(ON_DAMAGE_RECEIVED_PRE, function(_, damageinfo) local wep = damageinfo.Weapon local attacker = damageinfo.Attacker local dmgtype = damageinfo.DamageType if dmgtype & DMG_CRITICAL ~= 0 then damageinfo.Damage = damageinfo.Damage * 1.7325 end return true end) end) function OnGameTick() for _, player in pairs(ents.GetAllPlayers()) do if player:InCond(12) then player:SetAttributeValue("ignored by enemy sentries", 1) else player:SetAttributeValue("ignored by enemy sentries", nil) end end end