lee1hy 1 Posted March 26, 2013 im so freaking tired dead by one shot even wearing vest+plate i tested below script. AI is god mode is invincible running the script below, then it not work if script apply to player what is the problem? AI is god mode but not player http://forums.bistudio.com/showthread.php?88078-Script-based-body-armor ;Body armor script by Celery_exectime=time _unit=_this select 0 _bodypart=_this select 1 _damage=_this select 2 _source=_this select 3 _ammo=_this select 4 ?_bodypart=="head_hit":CLY_headhit=[_exectime,_unit,_bodypart,_damage,_source,_ammo] ?_bodypart=="body":CLY_bodyhit=[_exectime,_unit,_bodypart,_damage,_source,_ammo] ?_bodypart=="hands":CLY_handshit=[_exectime,_unit,_bodypart,_damage,_source,_ammo] ?_bodypart=="legs":CLY_legshit=[_exectime,_unit,_bodypart,_damage,_source,_ammo] ;Proceed to the next stage when all body parts are accounted for ?(CLY_headhit select 0)==_exectime and (CLY_bodyhit select 0)==_exectime and (CLY_handshit select 0)==_exectime and (CLY_legshit select 0)==_exectime:goto "damage" exit #damage _headd=CLY_headhit select 3 _bodyd=CLY_bodyhit select 3 _handsd=CLY_handshit select 3 _legsd=CLY_legshit select 3 ;Find the body part that was hit (normally all of them get some damage) _bigger=_headd max _bodyd _bigger=_bigger max _handsd _bigger=_bigger max _legsd ;Different body parts have different damage multipliers (otherwise every legshot would be fatal) ;In this case the body is protected with armor, giving it a damage threshold of 2 ?_bigger==_headd:_damage=_headd*0.5-damage _unit;goto "finaldamage" ?_bigger==_bodyd:_damage=(_bodyd-damage _unit*0.75-2)*0.5;goto "finaldamage" ?_bigger==_handsd:_damage=_handsd*0.25-damage _unit*0.1;goto "finaldamage" ?_bigger==_legsd:_damage=_legsd*0.25-damage _unit*0.1;goto "finaldamage" exit #finaldamage ?_damage<0:exit _unit setDamage damage _unit+_damage exit Share this post Link to post Share on other sites