Code: Select all
function MKombat_OnEvent()
if( event == "UNIT_HEALTH") then
if( arg1 == "target" and UnitHealth("target") < 20 and UnitHealth("target") > 0 and not healthFinishHim ) then
if( UnitName("target") and UnitIsPlayer("target") and UnitIsEnemy("player", "target") ) then
-- PLAY FINISH HIM!!!
MKombat_PlayFile( g_MKombat_Packs[MK_CurrentPack]["FINISH_THEM"] );
healthFinishHim = true;
end