health siphon
This commit is contained in:
parent
683a435234
commit
0094b4eec4
11
health_siphon/lua/autorun/server/health_siphon.lua
Normal file
11
health_siphon/lua/autorun/server/health_siphon.lua
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user