Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hook.Add("ScalePlayerDamage","t",function ( ply, hitgroup, dmginfo )
- print("HOOK ScalePlayerDamage - Damage: " .. dmginfo:GetDamage())
- end)
- hook.Add("EntityTakeDamage","t",function ( ent, inflictor, attacker, amount,dmginfo)
- print("HOOK EntityTakeDamage - Damage: " .. amount)
- end)
- local GM = GAMEMODE
- function GM:ScalePlayerDamage( ply, hitgroup, dmginfo )
- print("GAMEMODE BEFORE ScalePlayerDamage - Damage: " .. dmginfo:GetDamage())
- // More damage if we're shot in the head
- if ( hitgroup == HITGROUP_HEAD ) then
- dmginfo:ScaleDamage( 3 )
- end
- // Less damage if we're shot in the arms or legs
- if ( hitgroup == HITGROUP_LEFTARM ||
- hitgroup == HITGROUP_RIGHTARM ||
- hitgroup == HITGROUP_LEFTLEG ||
- hitgroup == HITGROUP_RIGHTLEG ||
- hitgroup == HITGROUP_GEAR )
- dmginfo:ScaleDamage( 0.5 )
- end
- print("GAMEMODE AFTER ScalePlayerDamage - Damage: " .. dmginfo:GetDamage())
- end
- function GM:EntityTakeDamage( ent, inflictor, attacker, amount, dmginfo )
- print("GAMEMODE EntityTakeDamage - Damage: " .. dmginfo:GetDamage())
- end
Add Comment
Please, Sign In to add comment