System to add a 'damage received' multiplier to players who are moving
2 replies, posted
Basically, players who are moving get damage increase, but I would rather have it so if they are moving at certain speeds, that's how the multiplier comes into effect. Something like that.
Under 10 movement speed: 1x damage
Between 10 and 110: 1.2x
Between 110 and 250: 1.5x
Between 250 and 350: 1.7x
[QUOTE=Kung Fu Jew;32084150][...]players who are moving get damage increase[...][/QUOTE]
Damage they are dealing, or damage they are receiving?
For dealing damage, use this:
[LUA]hook.Add("EntityTakeDamage","plscaledmg",function(ent,inflictor,attacker,damage,dmgInfo)
if(attacker:IsValid() && attacker:IsPlayer()) then
local flSpeed = attacker:GetVelocity():Length()
dmgInfo:ScaleDamage(flSpeed <= 10 && 1 || flSpeed <= 110 && 1.2 || flSpeed <= 250 && 1.5 || 1.7)
end
end)[/LUA]
For receiving, this:
[LUA]hook.Add("ScalePlayerDamage","plscaledmg",function(pl,hitgroup,dmgInfo)
local flSpeed = pl:GetVelocity():Length()
dmgInfo:ScaleDamage(flSpeed <= 10 && 1 || flSpeed <= 110 && 1.2 || flSpeed <= 250 && 1.5 || 1.7)
end)[/LUA]
Receiving. Should've clarified, sorry. It is basically an effort to reduce run-and-gunning.
Thank you very much though.
Sorry, you need to Log In to post a reply to this thread.