CTakeDamageInfo.ScaleDamage

From GMod Wiki

Jump to: navigation, search
Function
Syntax CTakeDamageInfo:ScaleDamage( Float scale )
Description:
Scales the damage in a DamageInfo.
Returns: nil
In Object: CTakeDamageInfo
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=CTakeDamageInfo.ScaleDamage]CTakeDamageInfo.ScaleDamage [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis makes headshots do ten times the damage dealt by the attacker.
Used onNewerServer.png
Code
function GM:ScaleNPCDamage(npc,hitgroup,dmginfo)
   if hitgroup < 2 then -- If it's a headshot or "no-shot" (melee/headcrab/etc)
      dmginfo:ScaleDamage(10)
   end
end
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox