Hi. I wrote a code. To the recipient of a dmg there had to be dmg in the 5th > more. But also attacking receives a dmg in 5 > more. Where I made a mistake in a code?
I want that the attacking didn't receive ScaleDamage = 5
[CODE]
local function HookEntityTakeDamage( target, dmg )
local _iam = dmg:GetInflictor( ply:GetActiveWeapon() )
if target:IsValid( entity ) and _iam then
dmg:ScaleDamage( 5.00 )
end
end
hook.Add( "EntityTakeDamage", "dmg01", HookEntityTakeDamage );
[/CODE]
[code]
local function ScaleSomeDamage( target, dmginfo )
if (target:IsPlayer()) then
dmginfo:ScaleDamage(5)
end
end
hook.Add( "EntityTakeDamage", "dmg01", ScaleSomeDamage )
[/code]
I don't understand the second part of your question. Do you want the person who attacked them to also take damage or something?
Are you receiving any errors? if so, post them here.
[QUOTE=Lolcats;47409054][code]
local function ScaleSomeDamage( target, dmginfo )
if (target:IsPlayer()) then
dmginfo:ScaleDamage(5)
end
end
hook.Add( "EntityTakeDamage", "dmg01", ScaleSomeDamage )
[/code]
I don't understand the second part of your question. Do you want the person who attacked them to also take damage or something?[/QUOTE]
I want that the attacking didn't receive ScaleDamage = 5
[editline]28th March 2015[/editline]
[QUOTE=Exploderguy;47409564]Are you receiving any errors? if so, post them here.[/QUOTE]
Nope
[QUOTE=godred2;47410458]I want that the attacking didn't receive ScaleDamage = 5
[editline]28th March 2015[/editline]
Nope[/QUOTE]
Not sure if it's me, but I don't understand anything you say.
It is just necessary to me that I shot in "X" the person and to it the increased dmg loss was caused.
Do you mean you want the attacker to gain the health the recipient lost?
[QUOTE=James xX;47411587]Do you mean you want the attacker to gain the health the recipient lost?[/QUOTE]
I want that only the recipient lost health
I think he just wants to increase the amount of damage dealt by a certain attacker, probably only a certain attacker, who causes more damage to the receiver, or victim.
Being dealt with in another thread for some reason.
Sorry, you need to Log In to post a reply to this thread.