LUA script that changes hitbox damage.

Hello, I’m teaching myself LUA through the fretta base. I wanted to make it where head shots would be an instant death. If it would be possible, add it where I could change the other hitboxes. Thank you. :slight_smile:

[lua]
function GM:ScalePlayerDamage( ply, hitgroup, dmginfo )

    // More damage if we're shot in the head
     if ( hitgroup == HITGROUP_HEAD ) then
     
            dmginfo:ScaleDamage( 50 ) //Some absurd number to assure they die
     
     end
     
    // Less damage if we're shot in the arms or legs
    if ( hitgroup == HITGROUP_LEFTARM ||
             hitgroup == HITGROUP_RIGHTARM ||
             hitgroup == HITGROUP_LEFTLEG ||
             hitgroup == HITGROUP_LEFTLEG ||
             hitgroup == HITGROUP_GEAR ) then
     
            dmginfo:ScaleDamage( 0.5 )

     end

end
[/lua]

Thank you, this helps a lot.