Hi, i tried to do an damagesystem for my gamemode which gives different damagetypes for every bodypart. 
but everytime i want to give damage to my player it doesn't work and the console says "bad argument". 
This is the (shortform) of the code i use: 
 
  
function dmg ( attacker, weapon, bodypart, loss) 
  
if ( bodypart == 9 ) then 
    SetElementHealth ( source, ( getElementHealth ( source) - loss * 2 ) ) 
end 
end 
addEventHandler ( "onPlayerDamage", getRootElement(), dmg )