Jump to content

Taking Life on Body Hit


Axel

Recommended Posts

local damage_data = { 
[3] = 20, 
[4] = 30, 
[5] = 40, 
[6] = 50, 
[7] = 60, 
[8] = 70, 
[9] = 80, 
} 
  
addEventHandler ( "onPlayerDamage", getRootElement (), 
function ( attacker, weapon, bodypart, loss ) 
    if damage_data[bodypart] then 
        local health = getElementHealth(source) 
        local damage = damage_data[bodypart] 
        setElementHealth(source, tonumber(health)-tonumber(damage)) 
    end 
end) 

Body part names:

    3: Torso 
    4: Ass 
    5: Left Arm 
    6: Right Arm 
    7: Left Leg 
    8: Right leg 
    9: Head  

Something like that?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...