Help plz. rate of fire

This function it is possible to increase a dmg:


    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 );

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]

Big THX :smile:

[editline]22nd March 2015[/editline]

In rate of fire how many increases and under what condition?