your script uses 4 conditions before it will apply damage
Quote: " if ai_soldier_state[e]=="attack" then
if GetAnimationFrame(e)>damageframestart[e] and GetAnimationFrame(e)<damageframeend[e] then
if GetPlayerDistance(e)<90 then
if GetTimer(e) > lastswipe[e] then
"
now if you apply a sound at slot 1 then does it play when you see him attack? if so then all conditions are being met, if not then one or more are not true.
most likely 'if GetPlayerDistance(e) < 90 then' is fine because that is already checked once to trigger the attack animation beforehand.
also again the 'ai_soldier_state[e]' should equal "attack" as this is set when the attack animation is called.
the timer might be an issue as it is set to 1s delay each time but only gets reset once the damage has applied so it should apply at least some of the time (if the animation is short/fast).
and finally the animation frames for 'damageframestart[e]' and 'damageframeend[e]' must be inside the 'attackstart[e]' and 'attackend[e]' range (which they are in the script posted above, so shouldnt be an issue but is the most likely issue, double check for mistakes).
1 more thing to consider is that the player is temporarily immune to damage on respawn.
other than that, can't see any obvious issues with the script