Mr trivel 'Hurt sounds' plays even when character gets healed

Sorry if I'm posting in the wrong thread or something.

Yeah, like the title says I'm using this old script called "Hurt sounds" by Mr.Trivel.
It works fine except that it plays all the time even if a character gets healed,
and it just sounds goofy.

I don't know anything about scripting and such so maybe someone out here
could help.

I'm just looking for a way to modify it so that the sound does not play when
you get healed and only when you get damaged.

Any help would be much appreciated.


Script redacted as reposting it violates the author’s terms. Please link to the script. Thank you. - Moderator.
Just to note: it's general good practice to not paste entire scripts from someone else into your forum post.

And, specifically in this case, from the terms of use link embedded in the script:
1702415011911.png
You can paste this patch in a new script section right below that script's.

Ruby:
class Game_Battler
  def no_sound_or_no_damage?
    @hurt_sound.nil? or @result.hp_damage <= 0 or @result.mp_damage <= 0
  end

  def execute_damage(user)
    on_damage(@result.hp_damage) if @result.hp_damage > 0
    self.hp -= @result.hp_damage
    self.mp -= @result.mp_damage
    user.hp += @result.hp_drain
    user.mp += @result.mp_drain
    return if no_sound_or_no_damage?
    Audio.se_play(@hurt_sound[0], @hurt_sound[1], @hurt_sound[2])
  end
end
I would also add on to use spoiler tags and code blocks instead of pasting it in directly.
That is when you're not violating the terms of use.
he was old friend we created this together he scripted i created tiles. not hear from him for many years hope he still alive! VXace

Original thread: https://forums.rpgmakerweb.com/threads/mr-trivel-hurt-sounds-plays-even-when-character-gets-healed.163796/