This function it is possible to increase a dmg:
[CODE] local function HookEntityTakeDamage( victim, dmg )
if( IsValid( dmg:GetAttacker() ) && dmg:GetAttacker():IsPlayer() ) then
dmg:ScaleDamage( 1.25 )
end
end
hook.Add( "EntityTakeDamage", "hook_name", HookEntityTakeDamage );[/CODE]
And what function it is possible to increase rate of fire?
Pretty sure SWEP.Primary.Delay can do this.
Why yes of course, it is possible to increase the attacker's weapon's rate of fire after an entity takes damage!
[lua]
local function HookEntityTakeDamage(victim, dmg)
if IsValid(dmg:GetAttacker()) and dmg:GetAttacker():IsPlayer() then
dmg:ScaleDamage(1.25)
local weapon = dmg:GetInflictor()
if IsValid(weapon) and weapon.Primary and weapon.Primary.Delay then
weapon.Primary.Delay = weapon.Primary.Delay/2
end
end
end
hook.Add("EntityTakeDamage", "hook_name", HookEntityTakeDamage)
[/lua]
[QUOTE=Ylsid;47373200]Why yes of course, it is possible to increase the attacker's weapon's rate of fire after an entity takes damage!
[lua]
local function HookEntityTakeDamage(victim, dmg)
if IsValid(dmg:GetAttacker()) and dmg:GetAttacker():IsPlayer() then
dmg:ScaleDamage(1.25)
local weapon = dmg:GetInflictor()
if IsValid(weapon) and weapon.Primary and weapon.Primary.Delay then
weapon.Primary.Delay = weapon.Primary.Delay/2
end
end
end
hook.Add("EntityTakeDamage", "hook_name", HookEntityTakeDamage)
[/lua][/QUOTE]
Big THX :smile:
[editline]22nd March 2015[/editline]
[QUOTE=Ylsid;47373200]Why yes of course, it is possible to increase the attacker's weapon's rate of fire after an entity takes damage!
[lua]
local function HookEntityTakeDamage(victim, dmg)
if IsValid(dmg:GetAttacker()) and dmg:GetAttacker():IsPlayer() then
dmg:ScaleDamage(1.25)
local weapon = dmg:GetInflictor()
if IsValid(weapon) and weapon.Primary and weapon.Primary.Delay then
weapon.Primary.Delay = weapon.Primary.Delay/2
end
end
end
hook.Add("EntityTakeDamage", "hook_name", HookEntityTakeDamage)
[/lua][/QUOTE]
In rate of fire how many increases and under what condition?
Sorry, you need to Log In to post a reply to this thread.