Axel Posted July 29, 2011 Posted July 29, 2011 I need some help in making a script like this: When a player hits a body part of another player he should recive a specified damage. Like: HeadShot- -60hp ArmShot- -10hp ....
Castillo Posted July 29, 2011 Posted July 29, 2011 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? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted July 29, 2011 Posted July 29, 2011 You welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now