diff --git a/health_siphon/lua/autorun/server/health_siphon.lua b/health_siphon/lua/autorun/server/health_siphon.lua new file mode 100644 index 0000000..e37568d --- /dev/null +++ b/health_siphon/lua/autorun/server/health_siphon.lua @@ -0,0 +1,11 @@ + +hook.Add("EntityTakeDamage", "edshot_health_siphon", function(target, dmg) + if dmg:IsBulletDamage() then + local attacker = dmg:GetAttacker() + + if IsValid(attacker) and attacker:Alive() then + local health = (attacker:Health() + (dmg:GetDamage() / 4)) + attacker:SetHealth( math.Clamp(health, 0, attacker:GetMaxHealth()) ) + end + end +end)